From 19e9d1e56cfbe27cd23bec283954fdd68e548c77 Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 13 Oct 2025 12:11:49 -0700 Subject: [PATCH 1/3] Fix for "benchmark" command to support float with nano.specs. Increase test-app heap size. --- test-app/ARM-stm32h5-ns.ld | 2 +- test-app/ARM-stm32h5.ld | 2 +- test-app/Makefile | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test-app/ARM-stm32h5-ns.ld b/test-app/ARM-stm32h5-ns.ld index b8d7133752..735514377f 100644 --- a/test-app/ARM-stm32h5-ns.ld +++ b/test-app/ARM-stm32h5-ns.ld @@ -50,5 +50,5 @@ SECTIONS } PROVIDE(_start_heap = _end); -PROVIDE(_heap_size = 4K); +PROVIDE(_heap_size = 8K); PROVIDE(_end_stack = ORIGIN(RAM) + LENGTH(RAM)); diff --git a/test-app/ARM-stm32h5.ld b/test-app/ARM-stm32h5.ld index a225a39ab1..f6001569ed 100644 --- a/test-app/ARM-stm32h5.ld +++ b/test-app/ARM-stm32h5.ld @@ -50,5 +50,5 @@ SECTIONS } PROVIDE(_start_heap = _end); -PROVIDE(_heap_size = 4K); +PROVIDE(_heap_size = 8K); PROVIDE(_end_stack = ORIGIN(RAM) + LENGTH(RAM)); diff --git a/test-app/Makefile b/test-app/Makefile index 5d35498bd4..3b232f7b2f 100644 --- a/test-app/Makefile +++ b/test-app/Makefile @@ -114,7 +114,8 @@ ifeq ($(TZEN),1) APP_OBJS+=./wcs/wc_encrypt.o APP_OBJS+=./wcs/wc_port.o endif - CFLAGS+=-DWOLFBOOT_SECURE_CALLS -Wstack-usage=12944 + CFLAGS+=-DWOLFBOOT_SECURE_CALLS -Wstack-usage=19184 + LDFLAGS+=--specs=nosys.specs -u _printf_float endif else APP_OBJS+=../hal/$(TARGET).o From 4c1b39f354ff2929c2ad3d6d54c466490f0ecdf6 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 14 Oct 2025 17:05:12 -0700 Subject: [PATCH 2/3] Fixes to support latest wolfSSL (disable KDF/PRF) --- Makefile | 2 +- include/user_settings.h | 1 + test-app/wcs/user_settings.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2a939fc637..534e7dba29 100644 --- a/Makefile +++ b/Makefile @@ -440,7 +440,7 @@ clean: $(Q)rm -f tools/keytools/otp/otp-keystore-gen $(Q)rm -f .stack_usage $(Q)rm -f $(WH_NVM_BIN) $(WH_NVM_HEX) - $(Q)$(MAKE) -C test-app -s clean + $(Q)$(MAKE) -C test-app clean V=$(V) $(Q)$(MAKE) -C tools/check_config -s clean $(Q)$(MAKE) -C stage1 -s clean diff --git a/include/user_settings.h b/include/user_settings.h index 6cc6305df7..6086cf21cb 100644 --- a/include/user_settings.h +++ b/include/user_settings.h @@ -474,6 +474,7 @@ extern int tolower(int c); #define NO_PKCS12 #define NO_PKCS8 #define NO_CHECK_PRIVATE_KEY +#define NO_KDF #define BENCH_EMBEDDED #define NO_CRYPT_TEST diff --git a/test-app/wcs/user_settings.h b/test-app/wcs/user_settings.h index f3796f33c7..8939056f79 100644 --- a/test-app/wcs/user_settings.h +++ b/test-app/wcs/user_settings.h @@ -132,6 +132,7 @@ extern int tolower(int c); #define WOLFSSL_NO_SOCK #define WOLFSSL_IGNORE_FILE_WARN #define NO_ERROR_STRINGS +#define NO_KDF #define BENCH_EMBEDDED From 0d66d3e4e2ca26faaed54782dd6b059c39567135 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 15 Oct 2025 11:28:21 -0700 Subject: [PATCH 3/3] Reverted change for H5 heap (not needed). Tracked issue down to a missing malloc fixed here: https://github.com/wolfSSL/wolfssl/pull/9305 --- include/user_settings.h | 8 ++++++++ test-app/ARM-stm32h5-ns.ld | 2 +- test-app/ARM-stm32h5.ld | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/user_settings.h b/include/user_settings.h index 6086cf21cb..2e2bde2132 100644 --- a/include/user_settings.h +++ b/include/user_settings.h @@ -232,6 +232,8 @@ extern int tolower(int c); # define WOLFSSL_SP_NO_3072 # define WOLFSSL_SP_NO_4096 # define WOLFSSL_SP_2048 +# define RSA_MIN_SIZE 2048 +# define RSA_MAX_SIZE 2048 # endif # if defined(WOLFBOOT_SIGN_RSA3072) || defined(WOLFBOOT_SIGN_SECONDARY_RSA3072) # define FP_MAX_BITS (3072 * 2) @@ -239,6 +241,8 @@ extern int tolower(int c); # define WOLFSSL_SP_NO_2048 # define WOLFSSL_SP_NO_4096 # define WOLFSSL_SP_3072 +# define RSA_MIN_SIZE 3072 +# define RSA_MAX_SIZE 3072 # endif # if defined(WOLFBOOT_SIGN_RSA4096) || defined(WOLFBOOT_SIGN_SECONDARY_RSA4096) @@ -247,6 +251,8 @@ extern int tolower(int c); # define WOLFSSL_SP_NO_2048 # define WOLFSSL_SP_NO_3072 # define WOLFSSL_SP_4096 +# define RSA_MIN_SIZE 4096 +# define RSA_MAX_SIZE 4096 # endif # ifdef WOLFCRYPT_SECURE_MODE # undef FP_MAX_BITS @@ -255,6 +261,8 @@ extern int tolower(int c); # define WOLFSSL_SP_2048 # define WOLFSSL_SP_3072 # define WOLFSSL_SP_4096 +# define RSA_MIN_SIZE 2048 +# define RSA_MAX_SIZE 4096 # endif #else # define NO_RSA diff --git a/test-app/ARM-stm32h5-ns.ld b/test-app/ARM-stm32h5-ns.ld index 735514377f..b8d7133752 100644 --- a/test-app/ARM-stm32h5-ns.ld +++ b/test-app/ARM-stm32h5-ns.ld @@ -50,5 +50,5 @@ SECTIONS } PROVIDE(_start_heap = _end); -PROVIDE(_heap_size = 8K); +PROVIDE(_heap_size = 4K); PROVIDE(_end_stack = ORIGIN(RAM) + LENGTH(RAM)); diff --git a/test-app/ARM-stm32h5.ld b/test-app/ARM-stm32h5.ld index f6001569ed..a225a39ab1 100644 --- a/test-app/ARM-stm32h5.ld +++ b/test-app/ARM-stm32h5.ld @@ -50,5 +50,5 @@ SECTIONS } PROVIDE(_start_heap = _end); -PROVIDE(_heap_size = 8K); +PROVIDE(_heap_size = 4K); PROVIDE(_end_stack = ORIGIN(RAM) + LENGTH(RAM));