SAML11 Xplained Pro: Implementation of MPU faild

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone, this is my first time to ask questions here. Please tell me what I missed.

 

Based on the implementation document of the SAML11 Xpro board, it supports two MPUs (https://www.mouser.com/new/microchip/microchip-sam-l10-l11-mcus/), one for a secure world, one for a non-secure world, both support 4 regions. 

But when I try to configure the MPU (https://static.docs.arm.com/1006...), there are some issues.

 

1. It seems this board only supports the MPU in the secure world. Because the MPU_TYPE in the secure world shows DEREGION is 4, but the MPY_TYPE in the non-secure world shows DEREGION is 0. And I can only configure the MPU in the secure world when debugging via Atmel IDE.

 

2. When configuring the MPU, we should also enable the MemManagement Fault Handler by configuring the SHCSR (System Handler Control and State Register). The "SCB_SHCSR_s |= (1<<16)" seems is ignored by the board and I don't know why. That is to say, after this line of code, the value of the SHCSR does not change. It is still the default value "0".

 

Following is the configuration of the MPU in the secure world:

#define MPU_CTRL_s *((volatile uint32_t*)0xE000ED94)
#define SCB_SHCSR_s *((volatile uint32_t*)0xE000ED24)

int main(void){
    // ...
    __asm volatile("dmb\n");     // Force any outstanding transfer to complete before disabling MPU
    MPU_CTRL_s = 0;              // Disable MPU
    SCB_SHCSR_s |= (1<<16) ;     // Enable Memory Management Fault Handler using SHCSR
    // ...
}

I want to know if anyone meets such issues or if anyone configures the MPU on this board successfully. Could you please give me some advice? Thank you very much!

Last Edited: Wed. Jul 29, 2020 - 01:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, not implementation, should be the configuration of MPU failed. Does anyone know how can I delete this topic? It shows an error when I try to edit it...

Last Edited: Wed. Jul 29, 2020 - 12:30 AM