@@ -78,7 +78,8 @@ void mbed_mpu_init()
78
78
(3 << MPU_RBAR_AP_Pos ) | // RO allowed by all privilege levels
79
79
(0 << MPU_RBAR_XN_Pos ); // Execute Never disabled
80
80
MPU -> RLAR = (0x1FFFFFFF & MPU_RLAR_LIMIT_Msk ) | // Last address is 0x1FFFFFFF
81
- (region << MPU_RLAR_AttrIndx_Pos ); // Attribute index - configured to be the same as the region number
81
+ (region << MPU_RLAR_AttrIndx_Pos ) | // Attribute index - configured to be the same as the region number
82
+ (1 << MPU_RLAR_EN_Pos ); // Region enabled
82
83
83
84
region = 1 ;
84
85
MPU -> RNR = region ;
@@ -90,7 +91,8 @@ void mbed_mpu_init()
90
91
(1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
91
92
(1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
92
93
MPU -> RLAR = (0x3FFFFFFF & MPU_RLAR_LIMIT_Msk ) | // Last address is 0x3FFFFFFF
93
- (region << MPU_RLAR_AttrIndx_Pos ); // Attribute index - configured to be the same as the region number
94
+ (region << MPU_RLAR_AttrIndx_Pos ) | // Attribute index - configured to be the same as the region number
95
+ (1 << MPU_RLAR_EN_Pos ); // Region enabled
94
96
95
97
region = 2 ;
96
98
MPU -> RNR = region ;
@@ -102,7 +104,8 @@ void mbed_mpu_init()
102
104
(1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
103
105
(1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
104
106
MPU -> RLAR = (0x7FFFFFFF & MPU_RLAR_LIMIT_Msk ) | // Last address is 0x7FFFFFFF
105
- (region << MPU_RLAR_AttrIndx_Pos ); // Attribute index - configured to be the same as the region number
107
+ (region << MPU_RLAR_AttrIndx_Pos ) | // Attribute index - configured to be the same as the region number
108
+ (1 << MPU_RLAR_EN_Pos ); // Region enabled
106
109
107
110
region = 3 ;
108
111
MPU -> RNR = region ;
@@ -114,7 +117,8 @@ void mbed_mpu_init()
114
117
(1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
115
118
(1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
116
119
MPU -> RLAR = (0x9FFFFFFF & MPU_RLAR_LIMIT_Msk ) | // Last address is 0x9FFFFFFF
117
- (region << MPU_RLAR_AttrIndx_Pos ); // Attribute index - configured to be the same as the region number
120
+ (region << MPU_RLAR_AttrIndx_Pos ) | // Attribute index - configured to be the same as the region number
121
+ (1 << MPU_RLAR_EN_Pos ); // Region enabled
118
122
119
123
// Enable the MPU
120
124
MPU -> CTRL =
0 commit comments