@@ -74,47 +74,47 @@ void mbed_mpu_init()
74
74
inner = 0xA ; // Write-Through, Non-transient, Read-allocate
75
75
ARM_MPU_SetMemAttrEx (MPU , region , (outer << 4 ) | (inner << 0 ));
76
76
MPU -> RBAR = (0x00000000 & MPU_RBAR_BASE_Msk ) | // Start address is 0x00000000
77
- (0 << MPU_RBAR_SH_Pos ) | // Not shareable
78
- (3 << MPU_RBAR_AP_Pos ) | // RO allowed by all privilege levels
79
- (0 << MPU_RBAR_XN_Pos ); // Execute Never disabled
77
+ (0 << MPU_RBAR_SH_Pos ) | // Not shareable
78
+ (3 << MPU_RBAR_AP_Pos ) | // RO allowed by all privilege levels
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
82
83
83
region = 1 ;
84
84
MPU -> RNR = region ;
85
85
outer = 0xF ; // Write-Back, Non-transient, Read-allocate, Write-allocate
86
86
outer = 0xF ; // Write-Back, Non-transient, Read-allocate, Write-allocate
87
87
ARM_MPU_SetMemAttrEx (MPU , region , (outer << 4 ) | (inner << 0 ));
88
88
MPU -> RBAR = (0x20000000 & MPU_RBAR_BASE_Msk ) | // Start address is 0x20000000
89
- (0 << MPU_RBAR_SH_Pos ) | // Not shareable
90
- (1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
91
- (1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
89
+ (0 << MPU_RBAR_SH_Pos ) | // Not shareable
90
+ (1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
91
+ (1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
92
92
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
93
+ (region << MPU_RLAR_AttrIndx_Pos ); // Attribute index - configured to be the same as the region number
94
94
95
95
region = 2 ;
96
96
MPU -> RNR = region ;
97
97
outer = 0xF ; // Write-Back, Non-transient, Read-allocate, Write-allocate
98
98
outer = 0xF ; // Write-Back, Non-transient, Read-allocate, Write-allocate
99
99
ARM_MPU_SetMemAttrEx (MPU , region , (outer << 4 ) | (inner << 0 ));
100
100
MPU -> RBAR = (0x60000000 & MPU_RBAR_BASE_Msk ) | // Start address is 0x60000000
101
- (0 << MPU_RBAR_SH_Pos ) | // Not shareable
102
- (1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
103
- (1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
101
+ (0 << MPU_RBAR_SH_Pos ) | // Not shareable
102
+ (1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
103
+ (1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
104
104
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
105
+ (region << MPU_RLAR_AttrIndx_Pos ); // Attribute index - configured to be the same as the region number
106
106
107
107
region = 3 ;
108
108
MPU -> RNR = region ;
109
109
outer = 0xA ; // Write-Through, Non-transient, Read-allocate
110
110
inner = 0xA ; // Write-Through, Non-transient, Read-allocate
111
111
ARM_MPU_SetMemAttrEx (MPU , region , (outer << 4 ) | (inner << 0 ));
112
112
MPU -> RBAR = (0x80000000 & MPU_RBAR_BASE_Msk ) | // Start address is 0x80000000
113
- (0 << MPU_RBAR_SH_Pos ) | // Not shareable
114
- (1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
115
- (1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
113
+ (0 << MPU_RBAR_SH_Pos ) | // Not shareable
114
+ (1 << MPU_RBAR_AP_Pos ) | // RW allowed by all privilege levels
115
+ (1 << MPU_RBAR_XN_Pos ); // Execute Never enabled
116
116
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
117
+ (region << MPU_RLAR_AttrIndx_Pos ); // Attribute index - configured to be the same as the region number
118
118
119
119
// Enable the MPU
120
120
MPU -> CTRL =
0 commit comments