Thanks Kef for your repy.
1) Isn't SVSEN=0 and CPU12X always in supervisor state?
As per the datasheet , when the SVSEN bit = 0 : MPU is disabled for the CPU in supervisor state.
When I tried clearing the SVSEN bit, illegal access are not being caught and this is not what I want.I have enabled the MPU for protection certian part of the EEPROM which contains certian parameters needed for my application.
2) I am writing into a protected area only once. The moment, the statement for writing into the protected area is executed, the software stops functioning and the software hangs. Since this happens in the very first write, the question of the access violation happening again and again doesnot arise.
My problems are as follows.
When I run my code in debugger mode, I am unable to put a breakpoint in the ISR of the MPU Illegal Access Interrupt. And I am incrementing a global variable, the moment the ISR is executed. But in none of the tests I have performed, does this global variable gets incremented which shows that the ISR is never called.
I hope the explanation was lucid enough.
Thanks in Advance.
Please do reply with your valuable suggestions.