Skip to content

Commit 6a09df3

Browse files
committed
boards: stm32l562e_dk: Enable TF-M IPC application
This commit enables the TF-M IPC sample application on stm32l562e_dk board. It provides device tree flash partition as an overlay in order to configure and flash the bl2, secure/non secure firmwares. Signed-off-by: Yestin Sun <[email protected]>
1 parent 09f32e3 commit 6a09df3

File tree

4 files changed

+70
-9
lines changed

4 files changed

+70
-9
lines changed

modules/trusted-firmware-m/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config TFM_BOARD
1414
default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_CPU0
1515
default "mps2/an521" if BOARD_MPS2_AN521
1616
default "stm/nucleo_l552ze_q" if BOARD_NUCLEO_L552ZE_Q
17+
default "stm/stm32l562e_dk" if BOARD_STM32L562E_DK
1718
default "musca_b1" if BOARD_MUSCA_B1
1819
default "musca_s1" if BOARD_MUSCA_S1
1920
help

samples/tfm_integration/tfm_ipc/README.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,33 +103,38 @@ Or, post build:
103103
104104
$ ninja run
105105
106-
On ST Nucleo L552ZE Q:
107-
======================
106+
On ST Nucleo L552ZE Q or STM32L562E-DK Discovery:
107+
=================================================
108108

109109
This sample was tested on Ubuntu 18.04 with Zephyr SDK 0.11.3.
110110

111111
Build Zephyr with a non-secure configuration:
112112

113+
Example, for building non-secure configuration for Nucleo L552ZE Q
114+
113115
.. code-block:: bash
114116
115117
$ west build -b nucleo_l552ze_q_ns samples/tfm_integration/tfm_ipc/
116118
117-
Two scripts are avalaible in the ``build/tfm`` folder:
119+
Example, for building non-secure configuration for STM32L562E-DK Discovery
120+
121+
.. code-block:: bash
122+
123+
$ west build -b stm32l562e_dk_ns samples/tfm_integration/tfm_ipc/
124+
125+
The script to initialize the device is avalaible in the ``build/tfm`` folder:
118126

119127
- ``regression.sh``: Sets platform option bytes config and erase platform.
120-
- ``TFM_UPDATE.sh``: Writes bl2, secure, and non secure image in target.
121128

122129
Run them in the following order to flash the board:
123130

124131
.. code-block:: bash
125132
126133
$ ./build/tfm/regression.sh
127-
$ ./build/tfm/TFM_UPDATE.sh
128-
129-
Reset the board.
134+
$ west flash --hex-file build/tfm_merged.hex
130135
131136
.. note::
132-
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.
137+
Note that ``arm-none-eabi-gcc`` should be available in the PATH variable and that ``STM32_Programmer_CLI`` is required to run ``regression.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` or :ref:`stm32l562e_dk_board` documentation.
133138

134139
On LPCxpresso55S69:
135140
===================
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright (c) 2021 Yestin Sun
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* This partition table should be used along with TFM configuration:
8+
* - TFM_PSA_API=ON (IPC)
9+
* - ISOLATION_LEVEL 2
10+
* - TEST_S=ON (REGRESSION)
11+
* - TEST_NS=OFF (By default)
12+
*
13+
* In this configuration, TFM binary includes tests. As a consequence,
14+
* its size is bloated and it is not possible to set secondary partitions
15+
* for secured or non secured images.
16+
*/
17+
18+
/ {
19+
chosen {
20+
zephyr,code-partition = &slot1_partition;
21+
};
22+
};
23+
24+
&flash0 {
25+
26+
partitions {
27+
compatible = "fixed-partitions";
28+
#address-cells = <1>;
29+
#size-cells = <1>;
30+
31+
boot_partition: partition@0 {
32+
label = "mcuboot";
33+
reg = <0x00000000 0x00013000>;
34+
read-only;
35+
};
36+
/* Secure image primary slot */
37+
slot0_partition: partition@00013000 {
38+
label = "image-0";
39+
reg = <0x00013000 0x00038000>;
40+
};
41+
/* Non-secure image primary slot */
42+
slot1_partition: partition@0004B000 {
43+
label = "image-1";
44+
reg = <0x0004B000 0x0002A000>;
45+
};
46+
/*
47+
* The flash starting at 0x7F000 and ending at
48+
* 0x80000 is reserved for the application.
49+
*/
50+
storage_partition: partition@7F000 {
51+
label = "storage";
52+
reg = <0x0007F000 0x00001000>;
53+
};
54+
};
55+
};

samples/tfm_integration/tfm_ipc/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tests:
77
tags: introduction tfm
88
platform_allow: mps2_an521_nonsecure lpcxpresso55s69_ns
99
nrf5340dk_nrf5340_cpuappns nrf9160dk_nrf9160ns nucleo_l552ze_q_ns
10-
v2m_musca_s1_nonsecure
10+
stm32l562e_dk_ns v2m_musca_s1_nonsecure
1111
harness: console
1212
harness_config:
1313
type: multi_line

0 commit comments

Comments
 (0)