Hi NXP,
I'm working on MPU (Memory Protection Unit) of MPC5777C.
"MPC5777CRM.pdf" says the MCU has two MPUs. (say: MPU-0, MPU-1).
- Problem: Details of why 2 MPUs are available and differences between them are not mentioned.
- Query - 1: So, can I assume that both MPUs are same or they have different features in the slaves they monitor and etc. (Sufficient information not available in MPC5777CRM.pdf, so please suggest where I can get this info of XBAR slaves that MPU-0, MPU-1 can monitor)
- Query - 2: MPU in MPC5777C cannot monitor flash is my conclusion after observing MCU block diagram. But, few example projects on MPU (MPC57xx) in Community shows that REGION-DESCRIPTORS being assigned with CODE-Region (Flash) addresses as mentioned below:
=========================================================================================
====== (User Query: When MPU cannot monitor FLASH, how can we assign flash addresses to RGD) ===========
/* Flash memory 4MB */ (User Query: When MPU cannot monitor FLASH, how can we assign flash address to RGD)
MPU.RGD[0].WORD0.R = 0x00000000; /* Start address */
MPU.RGD[0].WORD1.R = 0x0003FFFF; /* End address */
MPU.RGD[0].WORD2.R = 0x3F00001F; /* Read-write-execute allowed for all master */
MPU.RGD[0].WORD3.R = 0x00000001; /* Mark descriptor as valid */
=========================================================================================
Please let me know on this. Thanks in advance. MPC5777C architecture peter vlna david lukas
Hi, second MPU is added to provide 16 additional regions i.e. 32 regions at a whole. First uses 3 ports, second 2 ports.
MPUs are defined as follows
#define MPU_0 (*(volatile struct MPU_tag *) 0xFFF0C000UL)
#define MPU_1 (*(volatile struct MPU_tag *) 0xFFF10000UL)
And usage is following
MPU_0_RGD0_WORD0...
MPU_1_RGD0_WORD0...
Hi David,
Thank you for confirmation.
But, here remains one small query:
As per MPC5777C block diagram (Ch-2, Page: 93 of MPC 5777C), it shows that FLASH is not monitored by MPU.
So, may I know how in few MPU example codes from community is assigning FLASH_address_space to one of REGION_DESCRIPTOR (shown below):
======================================================================================
/* Flash memory 4MB */ (User Query: When MPU cannot monitor FLASH, how can we assign flash address to RGD)
MPU.RGD[0].WORD0.R = 0x00000000; /* Start address */ (This is flash address space)
MPU.RGD[0].WORD1.R = 0x0003FFFF; /* End address */ (This is flash address space)
MPU.RGD[0].WORD2.R = 0x3F00001F; /* Read-write-execute allowed for all master */
MPU.RGD[0].WORD3.R = 0x00000001; /* Mark descriptor as valid */
===========================================================================================