Testing of RAM access violation using SMPU in MPC5746R

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Testing of RAM access violation using SMPU in MPC5746R

668 Views
renjithr
Contributor I

Hi,

I have two separate RAM area for two level functions (L2 and L3).

The requirement is to give permission for L2 function to access only L2 RAM area, same for L3.

I wrote SMPU code in MPC5746R for setting permission for two RAM areas,by setting R/W access to L2 and L3 area as follows.

L2

-----------

//L2 RAM start address

SMPU_REG.RGD[0].WORD0 = SMPU_L2_RAM_STARTADDRESS;
//L2 RAM end address
SMPU_REG.RGD[0].WORD1 = SMPU_L2_RAM_ENDADDRESS;
/*Read write set for all masters */
SMPU_REG.RGD[0].WORD2 = SMPU_RW_ACCESS;

SMPU_REG.RGD[0].WORD3.REGFIELD = SMPU_RGD_VALID;

L3

-----------------

//L3 RAM start address

SMPU_REG.RGD[1].WORD0 = SMPU_L3_RAM_STARTADDRESS;
//L3 RAM end address
SMPU_REG.RGD[1].WORD1 = SMPU_L3_RAM_ENDADDRESS;
/*Read write set for all masters */
SMPU_REG.RGD[1].WORD2 = SMPU_RW_ACCESS;

SMPU_REG.RGD[1].WORD3.REGFIELD = SMPU_RGD_VALID;

I need to test whether L3 RAM area try to access L2 RAM area will cause violation and vice versa..?

Please give me a suggestion whether this method is correct..?

Thanks & Regards,

RR

Labels (1)
Tags (3)
0 Kudos
1 Reply

439 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

take a look at this example. It is written for MPC5748G but the principle is the same:

https://community.nxp.com/docs/DOC-332545 

Regards,

Lukas

0 Kudos