samples: tfm_integration: fix build & flash guides for all platforms

Add documentation on how to build and run the TF-M integration
samples on nRF platforms.

The arm-none-eabi-gcc does not need to be on the PATH anymore
for building and running the tfm_ipc sample on nucleo so remove
the note from the sample docs.

Fix some paths for TFM binaries for the LPC board as well.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2020-10-15 16:11:33 +02:00
commit a814f47c0c
2 changed files with 71 additions and 5 deletions

View file

@ -140,13 +140,46 @@ and non-secure (``zephyr.hex``) images wth a J-Link as follows:
.. code-block:: console .. code-block:: console
JLinkExe -device lpc55s69 -if swd -speed 2000 -autoconnect 1 JLinkExe -device lpc55s69 -if swd -speed 2000 -autoconnect 1
J-Link>loadfile build/tfm/install/outputs/LPC55S69/tfm_s.hex J-Link>loadfile build/tfm/install/outputs/NXP/LPCXPRESSO55S69/tfm_s.hex
J-Link>loadfile build/zephyr/zephyr.hex J-Link>loadfile build/zephyr/zephyr.hex
NOTE: At present, the LPC55S69 doesn't include support for the MCUBoot bootloader. NOTE: At present, the LPC55S69 doesn't include support for the MCUBoot bootloader.
We need to reset the board manually after flashing the image to run this code. We need to reset the board manually after flashing the image to run this code.
On nRF5340 and nRF9160:
=======================
Build Zephyr with a non-secure configuration
(``-DBOARD=nrf5340pdk_nrf5340_cpuappns`` or ``-DBOARD=nrf9160dk_nrf9160ns``).
Example, for nRF9160, using ``cmake`` and ``ninja``
.. code-block:: bash
cd <ZEPHYR_ROOT>/samples/tfm_integration/psa_level_1/
rm -rf build
mkdir build && cd build
cmake -GNinja -DBOARD=nrf9160dk_nrf9160ns ..
If building with BL2 (MCUboot bootloader) enabled, manually flash
the MCUboot bootloader image binary (``bl2.hex``).
Example, using ``nrfjprog`` on nRF9160:
.. code-block:: bash
nrfjprg -f NRF91 --program tfm/bin/bl2.hex --sectorerase
Finally, flash the concatenated TF-M + Zephyr binary.
Example, for nRF9160, using ``cmake`` and ``ninja``
.. code-block:: bash
ninja flash
Sample Output Sample Output
============= =============

View file

@ -114,7 +114,7 @@ Build Zephyr with a non-secure configuration:
$ west build -b nucleo_l552ze_q_ns samples/tfm_integration/tfm_ipc/ $ west build -b nucleo_l552ze_q_ns samples/tfm_integration/tfm_ipc/
Two scripts are avalaible in the ``build/tfm/install`` folder: Two scripts are avalaible in the ``build/tfm`` folder:
- ``regression.sh``: Sets platform option bytes config and erase platform. - ``regression.sh``: Sets platform option bytes config and erase platform.
- ``TFM_UPDATE.sh``: Writes bl2, secure, and non secure image in target. - ``TFM_UPDATE.sh``: Writes bl2, secure, and non secure image in target.
@ -123,8 +123,8 @@ Run them in the following order to flash the board:
.. code-block:: bash .. code-block:: bash
$ ./build/tfm/install/regression.sh $ ./build/tfm/regression.sh
$ ./build/tfm/install/TFM_UPDATE.sh $ ./build/tfm/TFM_UPDATE.sh
Reset the board. Reset the board.
@ -146,13 +146,46 @@ and non-secure (``zephyr.hex``) images wth a J-Link as follows:
.. code-block:: console .. code-block:: console
JLinkExe -device lpc55s69 -if swd -speed 2000 -autoconnect 1 JLinkExe -device lpc55s69 -if swd -speed 2000 -autoconnect 1
J-Link>loadfile build/tfm/install/outputs/LPC55S69/tfm_s.hex J-Link>loadfile build/tfm/install/outputs/NXP/LPCXPRESSO55S69/tfm_s.hex
J-Link>loadfile build/zephyr/zephyr.hex J-Link>loadfile build/zephyr/zephyr.hex
NOTE: At present, the LPC55S69 doesn't include support for the MCUBoot bootloader. NOTE: At present, the LPC55S69 doesn't include support for the MCUBoot bootloader.
We need to reset the board manually after flashing the image to run this code. We need to reset the board manually after flashing the image to run this code.
On nRF5340 and nRF9160:
=======================
Build Zephyr with a non-secure configuration
(``-DBOARD=nrf5340pdk_nrf5340_cpuappns`` or ``-DBOARD=nrf9160dk_nrf9160ns``).
Example, for nRF9160, using ``cmake`` and ``ninja``
.. code-block:: bash
cd <ZEPHYR_ROOT>/samples/tfm_integration/psa_level_1/
rm -rf build
mkdir build && cd build
cmake -GNinja -DBOARD=nrf9160dk_nrf9160ns ..
If building with BL2 (MCUboot bootloader) enabled, manually flash
the MCUboot bootloader image binary (``bl2.hex``).
Example, using ``nrfjprog`` on nRF9160:
.. code-block:: bash
nrfjprg -f NRF91 --program tfm/bin/bl2.hex --sectorerase
Finally, flash the concatenated TF-M + Zephyr binary.
Example, for nRF9160, using ``cmake`` and ``ninja``
.. code-block:: bash
ninja flash
Sample Output Sample Output
============= =============