stm32/Makefile: Set MPY_CROSS_FLAGS based on MCU type.

Previously it was hardcoded to armv7m, which would have failed on M0/M0+.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared 2022-11-16 14:45:29 +11:00 committed by Damien George
parent f34eedeb1b
commit 5ef3aec33c
2 changed files with 13 additions and 1 deletions

View File

@ -164,7 +164,7 @@ LDFLAGS += -L"$(shell dirname $(LIBSTDCPP_FILE_NAME))"
endif
# Options for mpy-cross
MPY_CROSS_FLAGS += -march=armv7m
MPY_CROSS_FLAGS += -march=$(MPY_CROSS_MCU_ARCH_$(MCU_SERIES))
SHARED_SRC_C += $(addprefix shared/,\
libc/string0.c \

View File

@ -69,3 +69,15 @@ CFLAGS_MCU_l4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
CFLAGS_MCU_h7 = $(CFLAGS_CORTEX_M) -mtune=cortex-m7 -mcpu=cortex-m7
CFLAGS_MCU_wb = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
CFLAGS_MCU_wl = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
MPY_CROSS_MCU_ARCH_f0 = armv6m
MPY_CROSS_MCU_ARCH_f4 = armv7m
MPY_CROSS_MCU_ARCH_f7 = armv7m
MPY_CROSS_MCU_ARCH_g0 = armv6m
MPY_CROSS_MCU_ARCH_g4 = armv7m
MPY_CROSS_MCU_ARCH_l0 = armv6m
MPY_CROSS_MCU_ARCH_l1 = armv7m
MPY_CROSS_MCU_ARCH_l4 = armv7m
MPY_CROSS_MCU_ARCH_h7 = armv7m
MPY_CROSS_MCU_ARCH_wb = armv7m
MPY_CROSS_MCU_ARCH_wl = armv7m