From d1e24b639a263a3b5234faf9e00fdfaa57ad42ba Mon Sep 17 00:00:00 2001 From: Brett Nicholas <7547222+bigbrett@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:34:40 -0700 Subject: [PATCH 1/3] Updates to wolfBoot-tc3xx and test-app ADS projects for ADS 1.10.6 This fix explicitly adds -mtc162 to compiler and linker flags in project settings to fix a build error when opening projects in ADS 1.10.6. Opening wolfBoot and test-app projects in ADS 1.10.6 resulted in compilation errors on tricore asm in IfxCpu.c. Newly created projects in 1.10.6 have -mctc162 passed as a compiler option, but older projects don't. Dropdown menu to set the CPU architecture is broken in IDE when trying to set in a project created with older ADS version. Explicitly adding -mtc162 fixes the issue. --- IDE/AURIX/test-app/.cproject | 17 ++++++++++------- .../test-app/.settings/language.settings.xml | 4 ++-- IDE/AURIX/wolfBoot-tc3xx/.cproject | 9 +++++++-- .../.settings/language.settings.xml | 4 ++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/IDE/AURIX/test-app/.cproject b/IDE/AURIX/test-app/.cproject index a07fde14f..fad1e03d0 100644 --- a/IDE/AURIX/test-app/.cproject +++ b/IDE/AURIX/test-app/.cproject @@ -20,7 +20,7 @@ - - @@ -203,7 +203,7 @@ - - @@ -382,7 +382,8 @@ - + @@ -448,7 +450,7 @@ - + @@ -551,7 +554,7 @@ - @@ -500,7 +502,7 @@ - @@ -515,6 +517,7 @@ + @@ -702,6 +705,7 @@ + @@ -712,6 +716,7 @@ + diff --git a/IDE/AURIX/wolfBoot-tc3xx/.settings/language.settings.xml b/IDE/AURIX/wolfBoot-tc3xx/.settings/language.settings.xml index 5947d5853..1f2ae1320 100644 --- a/IDE/AURIX/wolfBoot-tc3xx/.settings/language.settings.xml +++ b/IDE/AURIX/wolfBoot-tc3xx/.settings/language.settings.xml @@ -21,7 +21,7 @@ - + @@ -32,7 +32,7 @@ - + From 57d224bf765216a49a6d13211d400970940cce14 Mon Sep 17 00:00:00 2001 From: Brett Nicholas <7547222+bigbrett@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:50:16 -0700 Subject: [PATCH 2/3] Updates to wolfBoot-tc3xx-wolfHSM and test-app-wolfHSM ADS projects for ADS 1.10.6. Adds same fixes from d1e24b639a --- IDE/AURIX/test-app-wolfHSM/.cproject | 7 +++++-- IDE/AURIX/wolfBoot-tc3xx-wolfHSM/.cproject | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/IDE/AURIX/test-app-wolfHSM/.cproject b/IDE/AURIX/test-app-wolfHSM/.cproject index 3bee67d0f..f51bee99d 100644 --- a/IDE/AURIX/test-app-wolfHSM/.cproject +++ b/IDE/AURIX/test-app-wolfHSM/.cproject @@ -383,6 +383,7 @@ + @@ -448,7 +450,7 @@ - + @@ -551,7 +554,7 @@ - - @@ -505,7 +505,7 @@ - @@ -711,7 +711,7 @@ - @@ -722,6 +722,7 @@ + From a22a9b16863ecb2d7e9cb1cb1ba5ed03de192f7f Mon Sep 17 00:00:00 2001 From: Brett Nicholas <7547222+bigbrett@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:20:06 -0700 Subject: [PATCH 3/3] tc3xx: fix wolfBoot-tc3xx project and wbaurixtool.sh to properly generate macros for non-HSM projects --- IDE/AURIX/wolfBoot-tc3xx/.cproject | 4 ++-- tools/scripts/tc3xx/wbaurixtool.sh | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/IDE/AURIX/wolfBoot-tc3xx/.cproject b/IDE/AURIX/wolfBoot-tc3xx/.cproject index 8a3ff3a42..fc28f16ee 100644 --- a/IDE/AURIX/wolfBoot-tc3xx/.cproject +++ b/IDE/AURIX/wolfBoot-tc3xx/.cproject @@ -491,7 +491,7 @@ - @@ -705,7 +705,7 @@ - diff --git a/tools/scripts/tc3xx/wbaurixtool.sh b/tools/scripts/tc3xx/wbaurixtool.sh index 90c6553d8..59c7e089a 100644 --- a/tools/scripts/tc3xx/wbaurixtool.sh +++ b/tools/scripts/tc3xx/wbaurixtool.sh @@ -26,8 +26,6 @@ WOLFBOOT_DIR="../../../" PRVKEY_DER="$WOLFBOOT_DIR/priv.der" PUBKEY_DER="$WOLFBOOT_DIR/priv_pub.der" TARGET_H="$WOLFBOOT_DIR/include/target.h" -MACROS_IN="$WOLFBOOT_DIR/IDE/AURIX/wolfBoot-tc3xx-wolfHSM/wolfBoot_macros.in" -MACROS_OUT="$WOLFBOOT_DIR/IDE/AURIX/wolfBoot-tc3xx-wolfHSM/wolfBoot_macros.txt" NVM_CONFIG="$WOLFBOOT_DIR/tools/scripts/tc3xx/wolfBoot-wolfHSM-keys.nvminit" NVM_BIN="whNvmImage.bin" NVM_HEX="whNvmImage.hex" @@ -238,16 +236,22 @@ do_gen_target() { # Function to clean generated files do_clean() { echo "Cleaning generated files" + local macros_out="$WOLFBOOT_DIR/IDE/AURIX/wolfBoot-tc3xx${HSM:+-wolfHSM}/wolfBoot_macros.txt" + rm -f "$PRVKEY_DER" rm -f "$PUBKEY_DER" rm -f "$TARGET_H" - rm -f "$MACROS_OUT" + rm -f "$macros_out" rm -f "$NVM_BIN" rm -f "$NVM_HEX" } # Function to generate macros do_gen_macros() { + # Set the macros paths dynamically based on HSM flag + local macros_in="$WOLFBOOT_DIR/IDE/AURIX/wolfBoot-tc3xx${HSM:+-wolfHSM}/wolfBoot_macros.in" + local macros_out="$WOLFBOOT_DIR/IDE/AURIX/wolfBoot-tc3xx${HSM:+-wolfHSM}/wolfBoot_macros.txt" + # Use macros options first, then fall back to sign/keygen options local sign_algo="${MACROS_OPTS[sign_algo]:-${SIGN_OPTS[sign_algo]:-${KEYGEN_OPTS[sign_algo]:-$DEFAULT_SIGN_ALGO}}}" local hash_algo="${MACROS_OPTS[hash_algo]:-${SIGN_OPTS[hash_algo]}}" @@ -314,10 +318,10 @@ do_gen_macros() { -e "s/@ML_DSA_IMAGE_SIGNATURE_SIZE@/$ml_dsa_image_signature_size/g" \ -e "s/@WOLFBOOT_HUGE_STACK@/$use_huge_stack/g" \ -e "s/@WOLFBOOT_USE_WOLFHSM_PUBKEY_ID@/$use_wolfhsm_pubkey_id/g" \ - "$MACROS_IN" > "$MACROS_OUT" + "$macros_in" > "$macros_out" # Remove empty lines from the output file, as they cause compiler errors - sed -i '/^$/d' "$MACROS_OUT" + sed -i '/^$/d' "$macros_out" } # Function to generate a wolfHSM NVM image