diff --git a/puf/Makefile b/puf/Makefile index 7935f605..1c4a0d42 100644 --- a/puf/Makefile +++ b/puf/Makefile @@ -24,6 +24,10 @@ WOLFSSL_ROOT ?= ../../wolfssl BUILD_DIR = ./Build BIN = puf_example +# PUF test mode (default on): synthetic SRAM data for testing without hardware. +# Set PUF_TEST=0 to build for real hardware SRAM. +PUF_TEST ?= 1 + # Architecture ARCHFLAGS = -mcpu=cortex-m33 -mthumb -mabi=aapcs @@ -33,6 +37,10 @@ CFLAGS += -ffunction-sections -fdata-sections -fno-builtin CFLAGS += -DWOLFSSL_USER_SETTINGS CFLAGS += -I. -I$(WOLFSSL_ROOT) +ifeq ($(PUF_TEST),1) +CFLAGS += -DWOLFSSL_PUF_TEST +endif + # Linker flags LDFLAGS = $(ARCHFLAGS) LDFLAGS += --specs=nosys.specs --specs=nano.specs diff --git a/puf/user_settings.h b/puf/user_settings.h index 94175bda..5d5d8450 100644 --- a/puf/user_settings.h +++ b/puf/user_settings.h @@ -47,9 +47,10 @@ extern "C" { #define WOLFSSL_PUF #define WOLFSSL_PUF_SRAM -/* Enable test mode: allows synthetic SRAM data for testing without hardware. - * Comment out to use real SRAM PUF on actual hardware. */ -#define WOLFSSL_PUF_TEST +/* WOLFSSL_PUF_TEST enables test mode (synthetic SRAM data for testing + * without hardware). Controlled by the Makefile PUF_TEST switch: + * make (PUF_TEST=1, default) - test mode enabled + * make PUF_TEST=0 - real hardware SRAM PUF */ /* ------------------------------------------------------------------------- */ /* Required Dependencies */