Skip to content

Commit

Permalink
Add new CORTEX_M3 option (default ARCH=ARM is Cortex-M4). The M3 do…
Browse files Browse the repository at this point in the history
…es not support UMAAL.
  • Loading branch information
dgarske committed Sep 20, 2023
1 parent c337847 commit 03668f0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
24 changes: 19 additions & 5 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,29 @@ ifeq ($(ARCH),ARM)
endif
endif
else
# default Cortex M3/M4
ifeq ($(CORTEX_M3),1)
CFLAGS+=-mcpu=cortex-m3
LDFLAGS+=-mcpu=cortex-m3
ifeq ($(NO_ASM),1)
ifeq ($(SPMATH),1)
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_c32.o
endif
CFLAGS+=-mcpu=cortex-m3
LDFLAGS+=-mcpu=cortex-m3
else
CFLAGS+=-mcpu=cortex-m3 -fomit-frame-pointer
LDFLAGS+=-mcpu=cortex-m3
ifeq ($(SPMATH),1)
CFLAGS+=-DWOLFSSL_SP_ASM -DWOLFSSL_SP_ARM_CORTEX_M_ASM -DWOLFSSL_SP_NO_UMAAL
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_cortexm.o
endif
endif
else
# default Cortex M4
CFLAGS+=-mcpu=cortex-m4
LDFLAGS+=-mcpu=cortex-m4
ifeq ($(NO_ASM),1)
ifeq ($(SPMATH),1)
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_c32.o
endif
else
CFLAGS+=-fomit-frame-pointer # required with debug builds only
ifeq ($(SPMATH),1)
CFLAGS+=-DWOLFSSL_SP_ASM -DWOLFSSL_SP_ARM_CORTEX_M_ASM
MATH_OBJS += ./lib/wolfssl/wolfcrypt/src/sp_cortexm.o
Expand All @@ -218,6 +231,7 @@ ifeq ($(ARCH),ARM)
endif
endif
endif
endif

ifeq ($(TZEN),1)
CFLAGS+=-DTZEN
Expand Down
1 change: 1 addition & 0 deletions tools/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ifeq ($(ARCH),)
CORTEX_M0?=0
CORTEX_M33?=0
CORTEX_M7?=0
CORTEX_M3?=0
NO_ASM?=0
EXT_FLASH?=0
SPI_FLASH?=0
Expand Down
2 changes: 1 addition & 1 deletion tools/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ test-size-all:
make keysclean
make test-size SIGN=ECC384 NO_ASM=1 LIMIT=15172
make keysclean
make test-size SIGN=ED448 LIMIT=13418
make test-size SIGN=ED448 LIMIT=13420
make keysclean
make test-size SIGN=RSA3072 LIMIT=11386
make keysclean
Expand Down

0 comments on commit 03668f0

Please sign in to comment.