diff --git a/soc/nxp/imxrt/CMakeLists.txt b/soc/nxp/imxrt/CMakeLists.txt index 371938f7543cdc..b89d6ee5a213ea 100644 --- a/soc/nxp/imxrt/CMakeLists.txt +++ b/soc/nxp/imxrt/CMakeLists.txt @@ -16,7 +16,9 @@ if(CONFIG_SOC_SERIES_IMXRT10XX OR CONFIG_SOC_SERIES_IMXRT11XX) if(CONFIG_EXTERNAL_MEM_CONFIG_DATA) set(boot_hdr_xmcd_data_section ".boot_hdr.xmcd_data") endif() - zephyr_sources(mpu_regions.c) + if(NOT CONFIG_NXP_IMX_RT_USER_MPU_REGIONS) + zephyr_sources(mpu_regions.c) + endif() zephyr_linker_section_configure( SECTION .rom_start INPUT ".boot_hdr.conf" diff --git a/soc/nxp/imxrt/Kconfig b/soc/nxp/imxrt/Kconfig index 2ab29a50ce61f7..a9bc6a2378ee02 100644 --- a/soc/nxp/imxrt/Kconfig +++ b/soc/nxp/imxrt/Kconfig @@ -208,4 +208,11 @@ config INIT_SYS_PLL endif # SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX +config NXP_IMX_RT_USER_MPU_REGIONS + bool "User mpu regions" + help + When this option is enabled user should define custom mpu regions: + const struct arm_mpu_config mpu_config = {...}; + See example in zephyr/soc/nxp/imxrt/mpu_regions.c. + endif # SOC_FAMILY_NXP_IMXRT