:orphan: .. title:: ARM_MPU .. option:: CONFIG_ARM_MPU *ARM MPU Support* Type: ``bool`` Help ==== MCU implements Memory Protection Unit. Notes: The ARMv6-M and ARMv7-M MPU architecture requires a power-of-two alignment of MPU region base address and size. The NXP MPU as well as the ARMv8-M MPU do not require MPU regions to have power-of-two alignment for base address and region size. The ARMv8-M MPU requires the active MPU regions be non-overlapping. As a result of this, the ARMv8-M MPU needs to fully partition the memory map when programming dynamic memory regions (e.g. PRIV stack guard, user thread stack, and application memory domains), if the system requires PRIV access policy different from the access policy of the ARMv8-M background memory map. The application developer may enforce full PRIV (kernel) memory partition by enabling the CONFIG_MPU_GAP_FILLING option. By not enforcing full partition, MPU may leave part of kernel SRAM area covered only by the default ARMv8-M memory map. This is fine for User Mode, since the background ARM map does not allow nPRIV access at all. However, since the background map policy allows instruction fetches by privileged code, forcing this Kconfig option off prevents the system from directly triggering MemManage exceptions upon accidental attempts to execute code from SRAM in XIP builds. Since this does not compromise User Mode, we make the skipping of full partitioning the default behavior for the ARMv8-M MPU driver. Direct dependencies =================== \ :option:`CPU_HAS_MPU ` && \ :option:`CPU_CORTEX_M ` && !\ :option:`ARM64 ` && \ :option:`ARM ` *(Includes any dependencies from ifs and menus.)* Defaults ======== No defaults. Implicitly defaults to ``n``. Symbols selected by this symbol =============================== - \ :option:`MPU ` - \ :option:`SRAM_REGION_PERMISSIONS ` - \ :option:`THREAD_STACK_INFO ` - \ :option:`ARCH_HAS_EXECUTABLE_PAGE_BIT ` - \ :option:`MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT ` if !(\ :option:`CPU_HAS_NXP_MPU ` || \ :option:`ARMV8_M_BASELINE ` || \ :option:`ARMV8_M_MAINLINE `) - \ :option:`MPU_REQUIRES_NON_OVERLAPPING_REGIONS ` if \ :option:`CPU_HAS_ARM_MPU ` && (\ :option:`ARMV8_M_BASELINE ` || \ :option:`ARMV8_M_MAINLINE `) Symbols that select this symbol =============================== - \ :option:`ETH_MCUX ` Kconfig definition ================== .. highlight:: kconfig At ``arch/arm/core/aarch32/cortex_m/mpu/Kconfig:8`` Included via ``Kconfig:8`` → ``Kconfig.zephyr:29`` → ``arch/Kconfig:12`` → ``arch/arm/Kconfig:42`` → ``arch/arm/core/aarch32/Kconfig:237`` → ``arch/arm/core/aarch32/cortex_m/Kconfig:308`` Menu path: (Top) → ARM Options .. parsed-literal:: config ARM_MPU bool "ARM MPU Support" select \ :option:`MPU ` select \ :option:`SRAM_REGION_PERMISSIONS ` select \ :option:`THREAD_STACK_INFO ` select \ :option:`ARCH_HAS_EXECUTABLE_PAGE_BIT ` select \ :option:`MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT ` if !(\ :option:`CPU_HAS_NXP_MPU ` || \ :option:`ARMV8_M_BASELINE ` || \ :option:`ARMV8_M_MAINLINE `) select \ :option:`MPU_REQUIRES_NON_OVERLAPPING_REGIONS ` if \ :option:`CPU_HAS_ARM_MPU ` && (\ :option:`ARMV8_M_BASELINE ` || \ :option:`ARMV8_M_MAINLINE `) depends on \ :option:`CPU_HAS_MPU ` && \ :option:`CPU_CORTEX_M ` && !\ :option:`ARM64 ` && \ :option:`ARM ` help MCU implements Memory Protection Unit. Notes: The ARMv6-M and ARMv7-M MPU architecture requires a power-of-two alignment of MPU region base address and size. The NXP MPU as well as the ARMv8-M MPU do not require MPU regions to have power-of-two alignment for base address and region size. The ARMv8-M MPU requires the active MPU regions be non-overlapping. As a result of this, the ARMv8-M MPU needs to fully partition the memory map when programming dynamic memory regions (e.g. PRIV stack guard, user thread stack, and application memory domains), if the system requires PRIV access policy different from the access policy of the ARMv8-M background memory map. The application developer may enforce full PRIV (kernel) memory partition by enabling the CONFIG_MPU_GAP_FILLING option. By not enforcing full partition, MPU may leave part of kernel SRAM area covered only by the default ARMv8-M memory map. This is fine for User Mode, since the background ARM map does not allow nPRIV access at all. However, since the background map policy allows instruction fetches by privileged code, forcing this Kconfig option off prevents the system from directly triggering MemManage exceptions upon accidental attempts to execute code from SRAM in XIP builds. Since this does not compromise User Mode, we make the skipping of full partitioning the default behavior for the ARMv8-M MPU driver. *(The 'depends on' condition includes propagated dependencies from ifs and menus.)*