|
| 1 | +:orphan: |
| 2 | + |
| 3 | +.. _suit_flash_companion: |
| 4 | + |
| 5 | +SUIT flash companion |
| 6 | +#################### |
| 7 | + |
| 8 | +.. contents:: |
| 9 | + :local: |
| 10 | + :depth: 2 |
| 11 | + |
| 12 | +The SUIT flash companion sample allows the Secure Domain Firmware to access the external memory during the :ref:`Software Updates for Internet of Things (SUIT) <ug_nrf54h20_suit_dfu>` firmware upgrade. |
| 13 | + |
| 14 | +Requirements |
| 15 | +************ |
| 16 | + |
| 17 | +The sample supports the following development kit: |
| 18 | + |
| 19 | +.. table-from-rows:: /includes/sample_board_rows.txt |
| 20 | + :header: heading |
| 21 | + :rows: nrf54h20dk_nrf54h20_cpuapp |
| 22 | + |
| 23 | +Overview |
| 24 | +******** |
| 25 | + |
| 26 | +The flash companion sample implements a device driver for the external flash device and provides an IPC service to the Secure Domain Firmware. |
| 27 | +The Secure Domain Firmware uses the IPC service to read, erase, or write data to the external memory. |
| 28 | + |
| 29 | +The sample is meant to be booted by the Secure Domain while performing the firmware update process using the :ref:`SUIT <ug_nrf54h20_suit_dfu>` firmware upgrade. |
| 30 | + |
| 31 | +The flash companion sample is not a stand-alone firmware, it is intended to be used with the ``nrf54h_suit_sample`` to complete a firmware transfer with external flash. |
| 32 | + |
| 33 | +Configuration |
| 34 | +************* |
| 35 | + |
| 36 | +|config| |
| 37 | + |
| 38 | +Setup |
| 39 | +===== |
| 40 | + |
| 41 | +You can build the sample using Sysbuild by enabling the :kconfig:option:`SB_CONFIG_SUIT_BUILD_FLASH_COMPANION` Kconfig option. |
| 42 | +The memory partition from which the firmware will run can be configured by providing a devicetree overlay through Sysbuild. |
| 43 | +You should create a dedicated partition in non-volatile memory and override the ``zephyr,code-partition``. |
| 44 | +The memory partition must not be used by any other firmware image. |
| 45 | + |
| 46 | +The sample is booted during the SUIT firmware upgrade process. |
| 47 | +See the :ref:`ug_nrf54h20_suit_external_memory` user guide to learn how to setup your sample to boot and use the flash companion's services during firmware upgrade. |
| 48 | + |
| 49 | +Configuration options |
| 50 | +===================== |
| 51 | + |
| 52 | +Check and configure the following configuration option: |
| 53 | + |
| 54 | +.. _SB_CONFIG_SUIT_BUILD_FLASH_COMPANION: |
| 55 | + |
| 56 | +SB_CONFIG_SUIT_BUILD_FLASH_COMPANION - Configuration for the firmware |
| 57 | + This option enables the sample and builds it during the Sysbuild. |
| 58 | + |
| 59 | +Building and running |
| 60 | +******************** |
| 61 | + |
| 62 | +The flash companion sample is not a stand-alone firmware. |
| 63 | +To build it, open a different sample or application, such as :file:`samples/suit/smp_transfer`. |
| 64 | +Make sure that both the main application and the flash companion support your target platform. |
| 65 | + |
| 66 | +Perform the following steps in the main application directory: |
| 67 | + |
| 68 | +1. Enable the :kconfig:option:`SB_CONFIG_SUIT_BUILD_FLASH_COMPANION` Sysbuild option. |
| 69 | + |
| 70 | +#. Create :file:`sysbuild/flash_companion.overlay` devicetree overlay file and add the following content: |
| 71 | + |
| 72 | + a. Create a dedicated partition in non-volatile memory: |
| 73 | + |
| 74 | + .. code-block:: devicetree |
| 75 | +
|
| 76 | + &cpuapp_rx_partitions { |
| 77 | + cpuapp_slot0_partition: partition@a6000 { |
| 78 | + reg = <0xa6000 DT_SIZE_K(448)>; |
| 79 | + }; |
| 80 | + companion_partition: partition@116000 { |
| 81 | + reg = <0x116000 DT_SIZE_K(64)>; |
| 82 | + }; |
| 83 | + }; |
| 84 | +
|
| 85 | + In the above example the executable memory partition of the main application (``cpuapp_slot0_partition``) is shrunk to make space for the flash companion executable memory partition (``companion_partition``). |
| 86 | + |
| 87 | + #. Apply the same memory partition configuration to the main application's devicetree overlay. |
| 88 | + |
| 89 | + #. Enable SPI NOR devicetree node. |
| 90 | + In the case of nRF54H20 DK, you can enable the following node: |
| 91 | + |
| 92 | + .. code-block:: devicetree |
| 93 | +
|
| 94 | + &mx25uw63 { |
| 95 | + status = "okay"; |
| 96 | + }; |
| 97 | +
|
| 98 | +#. Build the main application: |
| 99 | + |
| 100 | + .. code-block:: console |
| 101 | +
|
| 102 | + $ west build -b nrf54h20dk/nrf54h20/cpuapp --sysbuild |
| 103 | +
|
| 104 | +The flash companion sample will be built automatically by Sysbuild. |
| 105 | + |
| 106 | +Dependencies |
| 107 | +************ |
| 108 | + |
| 109 | +This sample uses the following |NCS| libraries: |
| 110 | + |
| 111 | +* :file:`include/sdfw_services/ssf_client.h` |
| 112 | +* `zcbor`_ |
| 113 | + |
| 114 | +It uses the following Zephyr library: |
| 115 | + |
| 116 | +* :ref:`zephyr:flash_api` |
| 117 | + |
| 118 | +The sample also uses drivers from `nrfx`_. |
0 commit comments