From 6c0af30e385063e0e02a5bea6d3be521b62c3e80 Mon Sep 17 00:00:00 2001 From: robert-hh Date: Mon, 29 May 2023 11:38:49 +0200 Subject: [PATCH] mimxrt/Makefile: Use a specific fsl_flexspi_nor_boot.c for mimxrt1062. This one sets the flash image length properly for the teensy loader, such that the file system is not erased. It was already set in commit 8e542251405d780f7aa0d6c9abaa30282dd360d5 but got lost when the MIMXRT1176 board was added. Signed-off-by: robert-hh --- ports/mimxrt/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/mimxrt/Makefile b/ports/mimxrt/Makefile index dd053b3dc1..cfef8ee0f9 100644 --- a/ports/mimxrt/Makefile +++ b/ports/mimxrt/Makefile @@ -140,7 +140,13 @@ SRC_HAL_IMX_C += \ $(MCU_DIR)/drivers/fsl_snvs_lp.c \ $(MCU_DIR)/drivers/fsl_wdog.c \ $(MCU_DIR)/system_$(MCU_SERIES)$(MCU_CORE).c \ - $(MCU_DIR)/xip/fsl_flexspi_nor_boot.c \ + +# Use a specific boot header for 1062 so the Teensy loader doesn't erase the filesystem. +ifeq ($(MCU_SERIES), MIMXRT1062) +SRC_HAL_IMX_C += hal/fsl_flexspi_nor_boot.c +else +SRC_HAL_IMX_C += $(MCU_DIR)/xip/fsl_flexspi_nor_boot.c +endif ifeq ($(MICROPY_HW_SDRAM_AVAIL),1) SRC_HAL_IMX_C += $(MCU_DIR)/drivers/fsl_semc.c