Nycil Paul

MPU Access Violation ISR

Discussion created by Nycil Paul on Mar 8, 2011
Latest reply on Mar 9, 2011 by Nycil Paul

Hello All,

 

I am currently working on an S12XEP100. It was required to protect a certain area of the EEPROM ( 0x13F000'G - 0x13F036'G).  We started using the MPU module for protection. Configured the MPU module and protection seems to be working fine.

My problem is that when an write access to that protected areas occurs, the whole software resets. The Can signals stops working. I have to manually switch of and switch on my board.

I wrote an ISR which goes like this :

 

unsigned char mEep_V_FlashErrorCnt_u32[4]; /*Global variable array*/

 

ISR(mEep_F_MPUAccessErr_v){

 mEep_V_FlashErrorCnt_u32++;
  //read the status registers - what caused the error
  mEep_V_MPUBuffer_au32[0] = p_D_MPUFLG;
  mEep_V_MPUBuffer_au32[1] = p_D_MPUASTAT0;
  mEep_V_MPUBuffer_au32[2] = p_D_MPUASTAT1;
  mEep_V_MPUBuffer_au32[3] = p_D_MPUASTAT2;
  //--------------------------------
  //readdesc();  // read descriptors to check  - only for debug
  //insert code to visualize access error, or what you want
  //--------------------------------
  // you can do also nothing from above just clear the flag as below
  //--------------------------------
  // Clear MPU AEF
 p_D_MPUFLG  &= 0x80;

  return;


 

Some how it doesnot go into the interrupt. I have configured the interrupt to MPU access interrupt.  I am using vectors OSCAN for configuring the OS and the ISRs.

 

Regards,

Kiran

 

P.S. Thanks in Advance,

Do pour in with your valuable suggestions.

Outcomes