This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

execution fault after enabling mpu

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void test_mpu(){
ARM_MPU_SetMemAttr(0UL, ARM_MPU_ATTR( /* Normal memory */
ARM_MPU_ATTR_MEMORY_(0UL, 1UL, 1UL, 1UL), /* Outer Write-Back transient with read and write allocate */
ARM_MPU_ATTR_MEMORY_(0UL, 0UL, 1UL, 1UL) /* Inner Write-Through transient with read and write allocate */
));
ARM_MPU_SetRegion(0UL,
ARM_MPU_RBAR(0x00000000UL, ARM_MPU_SH_NON, 0UL, 1UL, 0UL), /* Non-shareable, read/write, non-privileged, execute-never */
ARM_MPU_RLAR(0x0000FFFFUL, 0UL) /* 1MB memory block using Attr 0 */
);
ARM_MPU_Enable(0x4);
// Execute application code that is access protected by the MPU
ARM_MPU_Disable();
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Hi

SAML11 board. I am trying to use mpu on sam11 with the code bellow.

After enabling the MPU, any instructions follows result in a hard fault.

Has anyone met the sam problem?

0