diff --git a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/README.md b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/README.md index 542bd75b445..5b03c916e63 100644 --- a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/README.md +++ b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/README.md @@ -5,12 +5,12 @@ This document guides how to rebuild TF-M and integrate with Mbed for M2354. ### Downloading TF-M source The M2354 port in TF-M must patch to enable TF-M integration with Mbed. -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: +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: - Apply Mbed-enabled patch to `nuvoton/m2354` TF-M target. Run the following command to fetch and switch to the intended version: ``` -$ git clone https://github.com/OpenNuvoton/trusted-firmware-m -b nuvoton_mbed_m2354_tfm-1.3 +$ git clone https://github.com/OpenNuvoton/trusted-firmware-m -b nuvoton_mbed_m2354_tfm-1.4 ``` ## Customizing TF-M @@ -96,7 +96,7 @@ $ cmake -S . \ -DTFM_PLATFORM=nuvoton/m2354 \ -DTFM_TOOLCHAIN_FILE=toolchain_GNUARM.cmake \ -DTFM_PSA_API=ON \ --DTFM_ISOLATION_LEVEL=2 \ +-DCMAKE_BUILD_TYPE=Release \ -G"Unix Makefiles" ``` @@ -132,6 +132,7 @@ The following TF-M exported stuffs must update into Mbed: Below summarize the copy paths from TF-M into Mbed: - trusted-firmware-m/cmake_build/install/outputs/NUVOTON/M2354/bl2.bin → bl2.bin +- trusted-firmware-m/cmake_build/install/outputs/NUVOTON/M2354/tfm_s.axf → tfm_s.axf - trusted-firmware-m/cmake_build/install/outputs/NUVOTON/M2354/tfm_s.bin → tfm_s.bin - trusted-firmware-m/cmake_build/install/interface/lib/s_veneers.o → s_veneers.o - trusted-firmware-m/platform/ext/target/nuvoton/m2354/partition/flash_layout.h → partition/flash_layout.h diff --git a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/bl2.bin b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/bl2.bin index aa9c12b0046..3fdad3bd316 100644 Binary files a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/bl2.bin and b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/bl2.bin differ diff --git a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.axf b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.axf index 2169bd346dc..4c8e693f1cc 100644 Binary files a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.axf and b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.axf differ diff --git a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.bin b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.bin index 960d34d2f29..a5f9ae7f5ba 100644 Binary files a/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.bin and b/targets/TARGET_NUVOTON/TARGET_M2354/TARGET_TFM/TARGET_NU_M2354/COMPONENT_TFM_S_FW/tfm_s.bin differ diff --git a/targets/TARGET_NUVOTON/scripts/NUVOTON.py b/targets/TARGET_NUVOTON/scripts/NUVOTON.py index 396838e57f8..e5b080671d1 100644 --- a/targets/TARGET_NUVOTON/scripts/NUVOTON.py +++ b/targets/TARGET_NUVOTON/scripts/NUVOTON.py @@ -90,7 +90,7 @@ def tfm_sign_image(tfm_import_path, signing_key, signing_key_1, non_secure_bin): # modified_timestamp = int(datetime.now().timestamp()) - int(datetime(2020, 1, 1).timestamp()) img_ver_major = 1 # Instead of (modified_timestamp >> 24) & 0xFF - img_ver_minor = 3 # Instead of (modified_timestamp >> 16) & 0xFF + img_ver_minor = 4 # Instead of (modified_timestamp >> 16) & 0xFF img_ver_revision = 0 # Instead of modified_timestamp & 0xFFFF img_ver_build = modified_timestamp diff --git a/tools/targets/NU_M2354.py b/tools/targets/NU_M2354.py index 8bada32af97..a6894a18145 100644 --- a/tools/targets/NU_M2354.py +++ b/tools/targets/NU_M2354.py @@ -98,7 +98,7 @@ def m2354_tfm_bin(t_self, non_secure_image, secure_bin): # modified_timestamp = int(datetime.now().timestamp()) - int(datetime(2020, 1, 1).timestamp()) img_ver_major = 1 # Instead of (modified_timestamp >> 24) & 0xFF - img_ver_minor = 3 # Instead of (modified_timestamp >> 16) & 0xFF + img_ver_minor = 4 # Instead of (modified_timestamp >> 16) & 0xFF img_ver_revision = 0 # Instead of modified_timestamp & 0xFFFF img_ver_build = modified_timestamp