Skip to content

Commit 9410a6f

Browse files
committed
Fixed Makefile to add Cortex-M0 support
1 parent 8f53638 commit 9410a6f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ TARGET?=stm32f4
1212
DEBUG?=0
1313
VTOR?=1
1414
SWAP?=1
15+
CORTEX_M0?=0
1516

1617
LSCRIPT:=hal/$(TARGET).ld
1718

@@ -28,7 +29,17 @@ OBJS:= \
2829
./lib/wolfssl/wolfcrypt/src/wolfmath.o \
2930
./lib/wolfssl/wolfcrypt/src/fe_low_mem.o
3031

31-
CFLAGS:=-mcpu=cortex-m3 -mthumb -Wall -Wextra -Wno-main -Wstack-usage=1024 -ffreestanding -Wno-unused \
32+
ifeq ($(TARGET),samr21)
33+
CORTEX_M0=1
34+
endif
35+
36+
ifeq ($(CORTEX_M0),1)
37+
CFLAGS:=-mcpu=cortex-m0
38+
else
39+
CFLAGS:=-mcpu=cortex-m3
40+
endif
41+
42+
CFLAGS+=-mthumb -Wall -Wextra -Wno-main -Wstack-usage=1024 -ffreestanding -Wno-unused \
3243
-Ilib/bootutil/include -Iinclude/ -Ilib/wolfssl -nostartfiles \
3344
-nostdlib \
3445
-DWOLFSSL_USER_SETTINGS \

0 commit comments

Comments
 (0)