@@ -723,6 +723,7 @@ static void prvSetupMPU( void )
723723 ( portPRIVILEGED_RAM_REGION );
724724
725725 portMPU_REGION_ATTRIBUTE_REG = ( portMPU_REGION_PRIVILEGED_READ_WRITE ) |
726+ ( portMPU_REGION_EXECUTE_NEVER ) |
726727 ( ( configTEX_S_C_B_SRAM & portMPU_RASR_TEX_S_C_B_MASK ) << portMPU_RASR_TEX_S_C_B_LOCATION ) |
727728 prvGetMPURegionSizeSetting ( ( uint32_t ) __privileged_data_end__ - ( uint32_t ) __privileged_data_start__ ) |
728729 ( portMPU_REGION_ENABLE );
@@ -834,6 +835,7 @@ void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
834835
835836 xMPUSettings -> xRegion [ 0 ].ulRegionAttribute =
836837 ( portMPU_REGION_READ_WRITE ) |
838+ ( portMPU_REGION_EXECUTE_NEVER ) |
837839 ( ( configTEX_S_C_B_SRAM & portMPU_RASR_TEX_S_C_B_MASK ) << portMPU_RASR_TEX_S_C_B_LOCATION ) |
838840 ( prvGetMPURegionSizeSetting ( ( uint32_t ) __SRAM_segment_end__ - ( uint32_t ) __SRAM_segment_start__ ) ) |
839841 ( portMPU_REGION_ENABLE );
@@ -860,7 +862,8 @@ void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
860862 ( portSTACK_REGION ); /* Region number. */
861863
862864 xMPUSettings -> xRegion [ 0 ].ulRegionAttribute =
863- ( portMPU_REGION_READ_WRITE ) | /* Read and write. */
865+ ( portMPU_REGION_READ_WRITE ) |
866+ ( portMPU_REGION_EXECUTE_NEVER ) |
864867 ( prvGetMPURegionSizeSetting ( ulStackDepth * ( uint32_t ) sizeof ( StackType_t ) ) ) |
865868 ( ( configTEX_S_C_B_SRAM & portMPU_RASR_TEX_S_C_B_MASK ) << portMPU_RASR_TEX_S_C_B_LOCATION ) |
866869 ( portMPU_REGION_ENABLE );
0 commit comments