stm32/stm32.mk: Error out if compiling for cortex-m55 on old gcc.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2025-07-08 15:25:28 +10:00
parent 50ea398b00
commit 99740dbace
3 changed files with 16 additions and 5 deletions

View File

@@ -60,6 +60,7 @@ include $(TOP)/extmod/extmod.mk
GIT_SUBMODULES += lib/libhydrogen lib/stm32lib
CROSS_COMPILE ?= arm-none-eabi-
LD_DIR=boards
USBDEV_DIR=usbdev
#USBHOST_DIR=usbhost
@@ -101,9 +102,6 @@ GEN_STMCONST_HDR = $(HEADER_BUILD)/modstm_const.h
GEN_STMCONST_MPZ = $(HEADER_BUILD)/modstm_mpz.h
CMSIS_MCU_HDR = $(STM32LIB_CMSIS_ABS)/Include/$(CMSIS_MCU_LOWER).h
# Select the cross compile prefix
CROSS_COMPILE ?= arm-none-eabi-
INC += -I.
INC += -I$(TOP)
INC += -I$(BUILD)

View File

@@ -48,6 +48,7 @@ endif
MBOOT_VERSION_ALLOCATED_BYTES ?= 64
MBOOT_VERSION_INCLUDE_OPTIONS ?= 1 # if set to 1, this will append build options to version string (see version.c)
CROSS_COMPILE ?= arm-none-eabi-
USBDEV_DIR=usbdev
DFU=$(TOP)/tools/dfu.py
PYDFU ?= $(TOP)/tools/pydfu.py
@@ -59,8 +60,6 @@ OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg
include ../stm32.mk
CROSS_COMPILE ?= arm-none-eabi-
INC += -I.
INC += -I..
INC += -I$(TOP)

View File

@@ -83,3 +83,17 @@ MPY_CROSS_MCU_ARCH_h7 = armv7m
MPY_CROSS_MCU_ARCH_n6 = armv7m # really armv8m
MPY_CROSS_MCU_ARCH_wb = armv7m
MPY_CROSS_MCU_ARCH_wl = armv7m
# gcc up to 14.2.0 have a known loop-optimisation bug:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116799
# This bug manifests for Cortex M55 targets, so require a newer compiler on such targets.
ifeq ($(MCU_SERIES),n6)
# Check if GCC version is less than 14.3
GCC_VERSION := $(shell $(CROSS_COMPILE)gcc -dumpversion | cut -d. -f1-2)
GCC_VERSION_MAJOR := $(shell echo $(GCC_VERSION) | cut -d. -f1)
GCC_VERSION_MINOR := $(shell echo $(GCC_VERSION) | cut -d. -f2)
GCC_VERSION_NUM := $(shell echo $$(($(GCC_VERSION_MAJOR) * 100 + $(GCC_VERSION_MINOR))))
ifeq ($(shell test $(GCC_VERSION_NUM) -lt 1403 && echo yes),yes)
$(error Error: GCC $(GCC_VERSION) has known issues with Cortex-M55; upgrade to GCC 14.3+ for proper CM55 support)
endif
endif