Skip to content

Commit 4cfbea4

Browse files
authored
Merge pull request #15078 from OpenNuvoton/nuvoton_m2354_tfm_1.4_fix
M2354: Fix TF-M 1.4
2 parents 810adf9 + bbc5ad9 commit 4cfbea4

File tree

6 files changed

+6
-5
lines changed

6 files changed

+6
-5
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ This document guides how to rebuild TF-M and integrate with Mbed for M2354.
55
### Downloading TF-M source
66

77
The M2354 port in TF-M must patch to enable TF-M integration with Mbed.
8-
For TF-M 1.3/Mbed integration for M2354, the [mainstream TF-M](https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git) is patched as follows:
8+
For TF-M 1.4/Mbed integration for M2354, the [mainstream TF-M](https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git) is patched as follows:
99
- Apply Mbed-enabled patch to `nuvoton/m2354` TF-M target.
1010

1111
Run the following command to fetch and switch to the intended version:
1212
```
13-
$ git clone https://github.com/OpenNuvoton/trusted-firmware-m -b nuvoton_mbed_m2354_tfm-1.3
13+
$ git clone https://github.com/OpenNuvoton/trusted-firmware-m -b nuvoton_mbed_m2354_tfm-1.4
1414
```
1515

1616
## Customizing TF-M
@@ -96,7 +96,7 @@ $ cmake -S . \
9696
-DTFM_PLATFORM=nuvoton/m2354 \
9797
-DTFM_TOOLCHAIN_FILE=toolchain_GNUARM.cmake \
9898
-DTFM_PSA_API=ON \
99-
-DTFM_ISOLATION_LEVEL=2 \
99+
-DCMAKE_BUILD_TYPE=Release \
100100
-G"Unix Makefiles"
101101
```
102102

@@ -132,6 +132,7 @@ The following TF-M exported stuffs must update into Mbed:
132132
Below summarize the copy paths from TF-M into Mbed:
133133

134134
- trusted-firmware-m/cmake_build/install/outputs/NUVOTON/M2354/bl2.bin → bl2.bin
135+
- trusted-firmware-m/cmake_build/install/outputs/NUVOTON/M2354/tfm_s.axf → tfm_s.axf
135136
- trusted-firmware-m/cmake_build/install/outputs/NUVOTON/M2354/tfm_s.bin → tfm_s.bin
136137
- trusted-firmware-m/cmake_build/install/interface/lib/s_veneers.o → s_veneers.o
137138
- trusted-firmware-m/platform/ext/target/nuvoton/m2354/partition/flash_layout.h → partition/flash_layout.h

targets/TARGET_NUVOTON/scripts/NUVOTON.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def tfm_sign_image(tfm_import_path, signing_key, signing_key_1, non_secure_bin):
9090
#
9191
modified_timestamp = int(datetime.now().timestamp()) - int(datetime(2020, 1, 1).timestamp())
9292
img_ver_major = 1 # Instead of (modified_timestamp >> 24) & 0xFF
93-
img_ver_minor = 3 # Instead of (modified_timestamp >> 16) & 0xFF
93+
img_ver_minor = 4 # Instead of (modified_timestamp >> 16) & 0xFF
9494
img_ver_revision = 0 # Instead of modified_timestamp & 0xFFFF
9595
img_ver_build = modified_timestamp
9696

tools/targets/NU_M2354.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def m2354_tfm_bin(t_self, non_secure_image, secure_bin):
9898
#
9999
modified_timestamp = int(datetime.now().timestamp()) - int(datetime(2020, 1, 1).timestamp())
100100
img_ver_major = 1 # Instead of (modified_timestamp >> 24) & 0xFF
101-
img_ver_minor = 3 # Instead of (modified_timestamp >> 16) & 0xFF
101+
img_ver_minor = 4 # Instead of (modified_timestamp >> 16) & 0xFF
102102
img_ver_revision = 0 # Instead of modified_timestamp & 0xFFFF
103103
img_ver_build = modified_timestamp
104104

0 commit comments

Comments
 (0)