AnsweredAssumed Answered

Testing of RAM access violation using SMPU in MPC5746R

Question asked by Renjith R on Jun 7, 2017
Latest reply on Jun 11, 2017 by Lukas Zadrapa

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

Outcomes