Skip to content

Commit af80d11

Browse files
authored
M2354: Fix some TF-M minor issues (#376)
* M2354: Update TF-M import document For Nuvoton M2354, this updates document to be consistent with TF-M import. * M2354: Pre-create cmake target mbed-m2354-tfm for custom_targets For M2354 custom target, there is dilemma on cmake target mbed-m2354-tfm: 1. mbed-m2354-tfm is created in mbed-os M2354 cmake listfile, but may be used in custom_targets M2354 cmake listfile in advance. 2. Build system requires add_subdirectory(custom_targets) be placed in front of add_subdirectory(mbed-os). To overcome above, mbed-m2354-tfm is pre-created on request and as singleton, E.g.: if(NOT TARGET mbed-m2354-tfm) add_library(mbed-m2354-tfm INTERFACE) endif()
1 parent 2692df3 commit af80d11

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
add_library(mbed-m2354-tfm INTERFACE)
4+
if(NOT TARGET mbed-m2354-tfm)
5+
add_library(mbed-m2354-tfm INTERFACE)
6+
endif()
57

68
if("NU_M2354" IN_LIST MBED_TARGET_LABELS)
79
add_subdirectory(TARGET_NU_M2354)

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ $ cmake -S . \
100100
-G"Unix Makefiles"
101101
```
102102

103+
**NOTE**: To build for NuMaker-IoT-M2354 board, add below lines to above:
104+
```
105+
-DNU_TGT_NUMAKER_M2354=OFF \
106+
-DNU_TGT_NUMAKER_IOT_M2354=ON \
107+
```
108+
103109
Then:
104110

105111
```
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Nuvoton M2354 RSA keypair
22

3-
A default RSA key pair is given to the Nuvoton M2354 target.
3+
Two default RSA key pairs are given to the Nuvoton M2354 target.
44

5-
Public key was pre-compiled to `targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/bl2.bin` and private key is in `nuvoton_m2354-root-rsa-3072.pem` for Secure image and `nuvoton_m2354-root-rsa-3072_1.pem` for Non-Secure image.
5+
Public keys were pre-compiled to `bl2.bin` and private keys are in
6+
`nuvoton_m2354-root-rsa-3072.pem` and `nuvoton_m2354-root-rsa-3072_1.pem`
7+
for Secure image and Non-Secure image separately.
68

79
DO NOT use them in production code, they are exclusively for testing!
810

9-
Private key must be stored in a safe place outside of the repository.
11+
Private keys must be stored in a safe place outside of the repository.
1012

11-
`tools/psa/tfm/bin_utils/imgtool.py` can be used to generate new key pairs.
13+
[Image tool](https://github.com/mcu-tools/mcuboot/blob/main/docs/imgtool.md)
14+
can be used to generate new key pairs.

0 commit comments

Comments
 (0)