Skip to content

Commit

Permalink
samples: tfm_integration: lpc55s69 support
Browse files Browse the repository at this point in the history
Adds documentation on how to run TFM samples on LPCxpresso55S69 board.

Signed-off-by: Andrei Gansari <[email protected]>
  • Loading branch information
agansari authored and MaureenHelm committed Sep 4, 2020
1 parent 7ff38a9 commit b8b31f9
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 22 deletions.
6 changes: 3 additions & 3 deletions boards/arm/lpcxpresso55s69/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ see the following message in the terminal:
Hello World! lpcxpresso55s69_cpu0
Building and flashing secure/non-secure with Arm |reg| TrustZone |reg|
---------------------------------------------------------------------
----------------------------------------------------------------------
The TF-M integration samples can be run using the ``lpcxpresso55s69_ns`` target.
Next we need to manually flash the secure (`tfm_s.hex`)
and non-secure (`zephyr.hex`) images wth a J-Link as follows:
Next we need to manually flash the secure (``tfm_s.hex``)
and non-secure (``zephyr.hex``) images wth a J-Link as follows:

.. code-block:: console
Expand Down
7 changes: 0 additions & 7 deletions samples/tfm_integration/psa_level_1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@ set(QEMU_KERNEL_OPTION "-device;loader,file=${CMAKE_BINARY_DIR}/tfm_qemu.hex")

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

set(BL2 $ENV{BL2})
if(NOT DEFINED BL2)
#by default build with MCUboot
set(BL2 True)
endif()

# Add "tfm" as an external project via the TF-M module's cmake file
trusted_firmware_build(BINARY_DIR ${CMAKE_BINARY_DIR}/tfm
BOARD ${TFM_TARGET_PLATFORM}
IPC
CFGFILE "ConfigRegressionIPC"
OUT_VENEERS_FILE VENEERS_FILE
BL2 ${BL2}
)

project(tfm_psa_level_1)
Expand Down
25 changes: 23 additions & 2 deletions samples/tfm_integration/psa_level_1/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Building and Running
********************

This project outputs startup status and info to the console. It can be built and
executed on an MPS2+ configured for AN521 (dual-core ARM Cortex M33), or using
the ``mps2_an521_nonsecure`` target with QEMU.
executed on an ARM Cortex M33 target board or QEMU.

This sample will only build on a Linux or macOS development system
(not Windows), and has been tested on the following setups:
Expand Down Expand Up @@ -126,6 +125,28 @@ and run it in qemu via the ``run`` command.
cmake -DBOARD=mps2_an521_nonsecure ..
make run
On LPCxpresso55S69:
======================

Build Zephyr with a non-secure configuration:

.. code-block:: bash
$ west build -p -b lpcxpresso55s69_ns samples/tfm_integration/psa_level_1/ --
Next we need to manually flash the secure (``tfm_s.hex``)
and non-secure (``zephyr.hex``) images wth a J-Link as follows:

.. code-block:: console
JLinkExe -device lpc55s69 -if swd -speed 2000 -autoconnect 1
J-Link>loadfile build/tfm/install/outputs/LPC55S69/tfm_s.hex
J-Link>loadfile build/zephyr/zephyr.hex
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.

Sample Output
=============

Expand Down
2 changes: 1 addition & 1 deletion samples/tfm_integration/psa_level_1/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sample:
tests:
sample.tfm_ipc:
tags: introduction
platform_allow: mps2_an521_nonsecure
platform_allow: mps2_an521_nonsecure lpcxpresso55s69_ns
harness: console
harness_config:
type: multi_line
Expand Down
8 changes: 0 additions & 8 deletions samples/tfm_integration/tfm_ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,20 @@ set(QEMU_KERNEL_OPTION "-device;loader,file=${CMAKE_BINARY_DIR}/tfm_qemu.hex")

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

set(BL2 $ENV{BL2})
if(NOT DEFINED BL2)
#by default build with MCUboot
set(BL2 True)
endif()

# Add "tfm" as an external project via the TF-M module's cmake file
if(${TFM_TARGET_PLATFORM} STREQUAL "STM_NUCLEO_L552ZE_Q")
trusted_firmware_build(BINARY_DIR ${CMAKE_BINARY_DIR}/tfm
BOARD ${TFM_TARGET_PLATFORM}
IPC
CFGFILE "ConfigRegressionIPCTfmLevel2"
OUT_VENEERS_FILE VENEERS_FILE
BL2 ${BL2}
)
else()
trusted_firmware_build(BINARY_DIR ${CMAKE_BINARY_DIR}/tfm
BOARD ${TFM_TARGET_PLATFORM}
IPC
CFGFILE "ConfigRegressionIPC"
OUT_VENEERS_FILE VENEERS_FILE
BL2 ${BL2}
)
endif()

Expand Down
21 changes: 21 additions & 0 deletions samples/tfm_integration/tfm_ipc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,27 @@ Reset the board.
.. note::
Note that ``arm-none-eabi-gcc`` should be available in the PATH variable and that ``STM32_Programmer_CLI`` is required to run ``regression.sh`` and ``TFM_UPDATE.sh`` (see https://www.st.com/en/development-tools/stm32cubeprog.html). If you are still having trouble running these scripts, check the Programming and Debugging section of the :ref:`nucleo_l552ze_q_board` documentation.

On LPCxpresso55S69:
===================

Build Zephyr with a non-secure configuration:

.. code-block:: bash
$ west build -p -b lpcxpresso55s69_ns samples/tfm_integration/tfm_ipc/ --
Next we need to manually flash the secure (``tfm_s.hex``)
and non-secure (``zephyr.hex``) images wth a J-Link as follows:

.. code-block:: console
JLinkExe -device lpc55s69 -if swd -speed 2000 -autoconnect 1
J-Link>loadfile build/tfm/install/outputs/LPC55S69/tfm_s.hex
J-Link>loadfile build/zephyr/zephyr.hex
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.

Sample Output
=============
Expand Down
2 changes: 1 addition & 1 deletion samples/tfm_integration/tfm_ipc/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sample:
tests:
sample.tfm_ipc:
tags: introduction
platform_allow: mps2_an521_nonsecure
platform_allow: mps2_an521_nonsecure lpcxpresso55s69_ns
harness: console
harness_config:
type: multi_line
Expand Down

0 comments on commit b8b31f9

Please sign in to comment.