From fed7eec0adce9f97d966644c005e31779ed7cf60 Mon Sep 17 00:00:00 2001 From: Mattia Moffa Date: Thu, 29 Jan 2026 23:27:07 +0100 Subject: [PATCH] Update MCUXpresso SDK for iMX-RT too --- .github/workflows/test-configs.yml | 33 +++++++++----- arch.mk | 62 +++++++++++++++++++++++---- config/examples/imx-rt1040.config | 8 ++-- config/examples/imx-rt1050.config | 8 ++-- config/examples/imx-rt1060.config | 8 ++-- config/examples/imx-rt1060_hab.config | 8 ++-- config/examples/imx-rt1064.config | 8 ++-- docs/Targets.md | 6 +-- hal/imx_rt.c | 4 +- test-app/Makefile | 49 +++++++++++++++------ 10 files changed, 138 insertions(+), 56 deletions(-) diff --git a/.github/workflows/test-configs.yml b/.github/workflows/test-configs.yml index 0875d261..b602e33d 100644 --- a/.github/workflows/test-configs.yml +++ b/.github/workflows/test-configs.yml @@ -42,74 +42,85 @@ jobs: config-file: ./config/examples/same51-dualbank.config imx_rt1040_test: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1040.config + board-name: evkmimxrt1040 imx_rt1050_test: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1050.config + board-name: evkbimxrt1050 imx_rt1060_test: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1060.config + board-name: evkbmimxrt1060 imx_rt1064_test: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1064.config + board-name: evkmimxrt1064 imx_rt1040_test_pka: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1040.config + board-name: evkmimxrt1040 make-args: PKA=1 NO_ARM_ASM=1 imx_rt1050_test_pka: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1050.config + board-name: evkbimxrt1050 make-args: PKA=1 NO_ARM_ASM=1 imx_rt1060_test_pka: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1060.config + board-name: evkbmimxrt1060 make-args: PKA=1 NO_ARM_ASM=1 imx_rt1064_test_pka: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1064.config + board-name: evkmimxrt1064 make-args: PKA=1 NO_ARM_ASM=1 imx_rt1060_hab_test: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/imx-rt1060_hab.config + board-name: evkbmimxrt1060 kinetis_k64f_test: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/kinetis-k64f.config + board-name: frdmk64f kinetis_k82f_test: - uses: ./.github/workflows/test-build-mcux-sdk.yml + uses: ./.github/workflows/test-build-mcux-sdk-manifests.yml with: arch: arm config-file: ./config/examples/kinetis-k82f.config + board-name: frdmk82f library_test: uses: ./.github/workflows/test-build.yml diff --git a/arch.mk b/arch.mk index f74df0f2..fb346538 100644 --- a/arch.mk +++ b/arch.mk @@ -821,8 +821,12 @@ ifeq ($(TARGET),imx_rt) ifeq ($(MCUXSDK),1) CFLAGS+=\ - -I$(MCUXPRESSO)/utilities/str \ - -I$(MCUXPRESSO)/utilities/debug_console + -I$(MCUXPRESSO_DRIVERS)/../periph \ + -I$(MCUXPRESSO)/components/debug_console \ + -I$(MCUXPRESSO)/components/debug_console/config \ + -I$(MCUXPRESSO)/components/lists \ + -I$(MCUXPRESSO)/components/str + CFLAGS+=-DDCB=CoreDebug -DDCB_DEMCR_TRCENA_Msk=CoreDebug_DEMCR_TRCENA_Msk OBJS+=\ $(MCUXPRESSO_DRIVERS)/drivers/fsl_clock.o \ $(MCUXPRESSO)/drivers/flexspi/fsl_flexspi.o \ @@ -851,32 +855,74 @@ ifeq ($(TARGET),imx_rt) ifeq ($(MCUXPRESSO_CPU),MIMXRT1064DVL6A) ARCH_FLASH_OFFSET=0x70000000 - CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1064/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1064/xip/ + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1064 + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1064/project_template + else + CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1064/xip/ + endif endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1062DVL6A) ARCH_FLASH_OFFSET=0x60000000 - CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/ + ifeq ($(MCUXSDK),1) + # Use evkbmimxrt1060 because evkmimxrt1060 is not supported by the SDK + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/xip/ + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060 + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/project_template + CFLAGS+=-I$(MCUXPRESSO)/devices/RT/RT1050/MIMXRT1052 + else + CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/ + endif endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1062DVL6B) ARCH_FLASH_OFFSET=0x60000000 - CFLAGS+=-I$(MCUXPRESSO)/boards/evkbmimxrt1060/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/xip/ + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060 + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/project_template + CFLAGS+=-I$(MCUXPRESSO)/devices/RT/RT1050/MIMXRT1052 + else + CFLAGS+=-I$(MCUXPRESSO)/boards/evkbmimxrt1060/xip/ + endif endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1061CVJ5B) ARCH_FLASH_OFFSET=0x60000000 - CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/ + ifeq ($(MCUXSDK),1) + # Use evkbmimxrt1060 because evkmimxrt1060 is not supported by the SDK + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/xip/ + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060 + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/project_template + CFLAGS+=-I$(MCUXPRESSO)/devices/RT/RT1050/MIMXRT1052 + else + CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/ + endif endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1052DVJ6B) ARCH_FLASH_OFFSET=0x60000000 - CFLAGS+=-I$(MCUXPRESSO)/boards/evkbimxrt1050/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbimxrt1050/xip/ + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbimxrt1050 + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbimxrt1050/project_template + else + CFLAGS+=-I$(MCUXPRESSO)/boards/evkbimxrt1050/xip/ + endif endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1042XJM5B) ARCH_FLASH_OFFSET=0x60000000 - CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1040/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1040/xip/ + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1040 + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1040/project_template + CFLAGS+=-I$(MCUXPRESSO)/devices/RT/RT1050/MIMXRT1052 + else + CFLAGS+=-I$(MCUXPRESSO)/boards/evkmimxrt1040/xip/ + endif endif ifeq ($(PKA),1) diff --git a/config/examples/imx-rt1040.config b/config/examples/imx-rt1040.config index a7ff8848..7aafeee1 100644 --- a/config/examples/imx-rt1040.config +++ b/config/examples/imx-rt1040.config @@ -2,11 +2,11 @@ ARCH?=ARM TARGET?=imx_rt SIGN?=ECC256 HASH?=SHA256 -MCUXSDK?=0 -MCUXPRESSO?=$(PWD)/../SDK_2_14_0_EVKB-IMXRT1040 -MCUXPRESSO_CMSIS?=$(MCUXPRESSO)/CMSIS +MCUXSDK?=1 +MCUXPRESSO?=$(PWD)/../NXP/mcuxpresso-sdk/mcuxsdk +MCUXPRESSO_CMSIS?=$(PWD)/../NXP/CMSIS_5/CMSIS MCUXPRESSO_CPU?=MIMXRT1042XJM5B -MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/MIMXRT1042 +MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/RT/RT1040/MIMXRT1042 DEBUG?=0 VTOR?=1 CORTEX_M0?=0 diff --git a/config/examples/imx-rt1050.config b/config/examples/imx-rt1050.config index 3c55d6c9..f81fdbd9 100644 --- a/config/examples/imx-rt1050.config +++ b/config/examples/imx-rt1050.config @@ -2,11 +2,11 @@ ARCH?=ARM TARGET?=imx_rt SIGN?=ECC256 HASH?=SHA256 -MCUXSDK?=0 -MCUXPRESSO?=$(PWD)/../SDK_2_14_0_EVKB-IMXRT1050 -MCUXPRESSO_CMSIS?=$(MCUXPRESSO)/CMSIS +MCUXSDK?=1 +MCUXPRESSO?=$(PWD)/../NXP/mcuxpresso-sdk/mcuxsdk +MCUXPRESSO_CMSIS?=$(PWD)/../NXP/CMSIS_5/CMSIS MCUXPRESSO_CPU?=MIMXRT1052DVJ6B -MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/MIMXRT1052 +MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/RT/RT1050/MIMXRT1052 DEBUG?=0 VTOR?=1 CORTEX_M0?=0 diff --git a/config/examples/imx-rt1060.config b/config/examples/imx-rt1060.config index 9a16cf5e..87ded644 100644 --- a/config/examples/imx-rt1060.config +++ b/config/examples/imx-rt1060.config @@ -2,11 +2,11 @@ ARCH?=ARM TARGET?=imx_rt SIGN?=ECC256 HASH?=SHA256 -MCUXSDK?=0 -MCUXPRESSO?=$(PWD)/../SDK-2.11.0_EVK-MIMXRT1060 -MCUXPRESSO_CMSIS?=$(MCUXPRESSO)/CMSIS +MCUXSDK?=1 +MCUXPRESSO?=$(PWD)/../NXP/mcuxpresso-sdk/mcuxsdk +MCUXPRESSO_CMSIS?=$(PWD)/../NXP/CMSIS_5/CMSIS MCUXPRESSO_CPU?=MIMXRT1062DVL6A -MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/MIMXRT1062 +MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/RT/RT1060/MIMXRT1062 DEBUG?=0 VTOR?=1 CORTEX_M0?=0 diff --git a/config/examples/imx-rt1060_hab.config b/config/examples/imx-rt1060_hab.config index b94e5d05..068b12fa 100644 --- a/config/examples/imx-rt1060_hab.config +++ b/config/examples/imx-rt1060_hab.config @@ -3,11 +3,11 @@ TARGET?=imx_rt TARGET_IMX_HAB?=1 SIGN?=ECC256 HASH?=SHA256 -MCUXSDK?=0 -MCUXPRESSO?=$(PWD)/../SDK-2.11.0_EVK-MIMXRT1060 -MCUXPRESSO_CMSIS?=$(MCUXPRESSO)/CMSIS +MCUXSDK?=1 +MCUXPRESSO?=$(PWD)/../NXP/mcuxpresso-sdk/mcuxsdk +MCUXPRESSO_CMSIS?=$(PWD)/../NXP/CMSIS_5/CMSIS MCUXPRESSO_CPU?=MIMXRT1062DVL6A -MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/MIMXRT1062 +MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/RT/RT1060/MIMXRT1062 DEBUG?=0 VTOR?=1 CORTEX_M0?=0 diff --git a/config/examples/imx-rt1064.config b/config/examples/imx-rt1064.config index b3787b33..1b054860 100644 --- a/config/examples/imx-rt1064.config +++ b/config/examples/imx-rt1064.config @@ -2,11 +2,11 @@ ARCH?=ARM TARGET?=imx_rt SIGN?=ECC256 HASH?=SHA256 -MCUXSDK?=0 -MCUXPRESSO?=$(PWD)/../SDK-2.11.0_EVK-MIMXRT1060 -MCUXPRESSO_CMSIS?=$(MCUXPRESSO)/CMSIS +MCUXSDK?=1 +MCUXPRESSO?=$(PWD)/../NXP/mcuxpresso-sdk/mcuxsdk +MCUXPRESSO_CMSIS?=$(PWD)/../NXP/CMSIS_5/CMSIS MCUXPRESSO_CPU?=MIMXRT1064DVL6A -MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/MIMXRT1064 +MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/RT/RT1064/MIMXRT1064 DEBUG?=0 VTOR?=1 CORTEX_M0?=0 diff --git a/docs/Targets.md b/docs/Targets.md index 7b72be4e..798132f8 100644 --- a/docs/Targets.md +++ b/docs/Targets.md @@ -2683,15 +2683,15 @@ wolfBoot support for iMX-RT1060/iMX-RT1050 has been tested using MCUXpresso SDK DCP support (hardware acceleration for SHA256 operations) can be enabled by using PKA=1 in the configuration file. You can also get the SDK and CMSIS bundles using these repositories: -* https://github.com/nxp-mcuxpresso/mcux-sdk +* https://github.com/nxp-mcuxpresso/mcuxsdk-manifests * https://github.com/nxp-mcuxpresso/CMSIS_5 Use MCUXSDK=1 with this option, since the pack paths are different. Example: ``` MCUXSDK?=1 -MCUXPRESSO?=$(PWD)/../mcux-sdk -MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/MIMXRT1062 +MCUXPRESSO?=$(PWD)/../NXP/mcuxpresso-sdk/mcuxsdk +MCUXPRESSO_DRIVERS?=$(MCUXPRESSO)/devices/RT/RT1060/MIMXRT1062 MCUXPRESSO_CMSIS?="$(PWD)/../CMSIS_5/CMSIS" ``` diff --git a/hal/imx_rt.c b/hal/imx_rt.c index 6ccdae70..f1eca554 100644 --- a/hal/imx_rt.c +++ b/hal/imx_rt.c @@ -40,7 +40,7 @@ #define USE_GET_CONFIG #endif #ifdef CPU_MIMXRT1062DVL6A -#include "evkmimxrt1060_flexspi_nor_config.h" +#include "evkbmimxrt1060_flexspi_nor_config.h" #define USE_GET_CONFIG #endif #ifdef CPU_MIMXRT1062DVL6B @@ -48,7 +48,7 @@ #define USE_GET_CONFIG #endif #ifdef CPU_MIMXRT1061CVJ5B -#include "evkmimxrt1060_flexspi_nor_config.h" +#include "evkbmimxrt1060_flexspi_nor_config.h" #define USE_GET_CONFIG #endif #ifdef CPU_MIMXRT1052DVJ6B diff --git a/test-app/Makefile b/test-app/Makefile index bc363731..a577f9a9 100644 --- a/test-app/Makefile +++ b/test-app/Makefile @@ -425,9 +425,9 @@ ifeq ($(TARGET),imx_rt) $(MCUXPRESSO)/drivers/common/fsl_common.o \ $(MCUXPRESSO)/drivers/common/fsl_common_arm.o \ $(MCUXPRESSO)/drivers/flexspi/fsl_flexspi.o \ - $(MCUXPRESSO)/utilities/str/fsl_str.o \ $(MCUXPRESSO)/drivers/lpuart/fsl_lpuart.o \ - $(MCUXPRESSO)/utilities/debug_console/fsl_debug_console.o + $(MCUXPRESSO)/components/str/fsl_str.o \ + $(MCUXPRESSO)/components/debug_console/fsl_debug_console.o else APP_OBJS+=\ $(MCUXPRESSO_DRIVERS)/drivers/fsl_gpio.o \ @@ -441,27 +441,52 @@ ifeq ($(TARGET),imx_rt) endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1042XJM5B) - CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ - -I$(MCUXPRESSO)/boards/evkmimxrt1040/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1040/project_template \ + -I$(MCUXPRESSO)/examples/_boards/evkmimxrt1040/xip/ + else + CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ + -I$(MCUXPRESSO)/boards/evkmimxrt1040/xip/ + endif APP_OBJS+=$(MCUXPRESSO_DRIVERS)/system_MIMXRT1042.o else ifeq ($(MCUXPRESSO_CPU),MIMXRT1052DVJ6B) - CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ - -I$(MCUXPRESSO)/boards/evkmimxrt1050/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbimxrt1050/project_template \ + -I$(MCUXPRESSO)/examples/_boards/evkbimxrt1050/xip/ + else + CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ + -I$(MCUXPRESSO)/boards/evkmimxrt1050/xip/ + endif APP_OBJS+=$(MCUXPRESSO_DRIVERS)/system_MIMXRT1052.o else ifeq ($(MCUXPRESSO_CPU),MIMXRT1062DVL6A) - CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ - -I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1060/project_template \ + -I$(MCUXPRESSO)/examples/_boards/evkmimxrt1060/xip/ + else + CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ + -I$(MCUXPRESSO)/boards/evkmimxrt1060/xip/ + endif APP_OBJS+=$(MCUXPRESSO_DRIVERS)/system_MIMXRT1062.o endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1062DVL6B) - CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ - -I$(MCUXPRESSO)/boards/evkbmimxrt1060/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/project_template \ + -I$(MCUXPRESSO)/examples/_boards/evkbmimxrt1060/xip/ + else + CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ + -I$(MCUXPRESSO)/boards/evkbmimxrt1060/xip/ + endif APP_OBJS+=$(MCUXPRESSO_DRIVERS)/system_MIMXRT1062.o endif ifeq ($(MCUXPRESSO_CPU),MIMXRT1064DVL6A) - CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ - -I$(MCUXPRESSO)/boards/evkmimxrt1064/xip/ + ifeq ($(MCUXSDK),1) + CFLAGS+=-I$(MCUXPRESSO)/examples/_boards/evkmimxrt1064/project_template \ + -I$(MCUXPRESSO)/examples/_boards/evkmimxrt1064/xip/ + else + CFLAGS+=-I$(MCUXPRESSO_DRIVERS)/project_template/ \ + -I$(MCUXPRESSO)/boards/evkmimxrt1064/xip/ + endif APP_OBJS+=$(MCUXPRESSO_DRIVERS)/system_MIMXRT1064.o endif endif