Size of Exception Handler

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

Size of Exception Handler

1,022 Views
kadiraktas
Contributor III

Hi,

I'm using MPC56xx and want to ask a question about 'exception handler'. 

Compiler warning --> interrupt function 'EXCEP_DefaultExceptionHandler()' is bigger than 256 bytes.

How is this limit value determined and is it possible to change this limit value?

0 Kudos
5 Replies

821 Views
stanish
NXP Employee
NXP Employee

Hello Kadir,

Could you possibly post the code where you assign EXCEP_DefaultExceptionHandler() is assigned to specific exception handlers (probaby an asm file) or better a sample project we can use to reproduce the warning.

This will help us to find the answer to this question.

 Thanks.

Stan

0 Kudos

821 Views
kadiraktas
Contributor III

Hello,

Thanks for reply. I use some functions in ExceptionHandler. In fact, my goal in all these operations is to fix the problem caused by a corrupted memory area. It is as follows: When erasing the memory area, the power is cut off due to corruption of that area and I get an error when I try to do something about that area and send me to ivor and exception...

When I look at the memory unit from the registers when I encounter this error, I see that the bit of EHV remains 1. 

If I can overcome this problem when power is gone, I won't need that much functions in ExceptionHandler. (I can roughly illustrate the contents of the exception.)

void EXCEP_DefaultExceptionHandler(void)
{
enableInterrupts();
flashUnlock();
flashErase();

memoryCopy();

writeToFlash();
Peripheral Initialization();
initialize Look Up Tables();
Initialize Huge Algorithm();
AssignValuetoSmwh();
Watchdog Activation();
Scheduler Initialization();

}

This funstions hold 272 bytes. Even if I put a function in the exception, it takes up 164 + x.. What is your opinion about flash memory or exception? Thanks.

0 Kudos

821 Views
stanish
NXP Employee
NXP Employee

Hello Kadir,

Thanks for the update.

I've checked this warning and it is really not applicable to MPC56xx architecture since e200 cores does not limit interrupt handler to fit 256 Bytes.

This compiler warning is based on an architecture limitation inherited from an older PowerPC architectures (RCPU /MPC5xx) where each exception has allocated 256 bytes for the handler.

Therefore I'd suggest you to ignore it by adding "nowarn" to your interrupt declaration.

With the adjusted __declspec declaration the warning should disappear:

__declspec(interrupt nowarn)
...
void EXCEP_DefaultExceptionHandler(void)

Hope it helps.

Stan

0 Kudos

821 Views
kadiraktas
Contributor III

Hello,

Thanks for reply again. So, do you have any idea about flash? How can I find a solution to keep the EHV?

If I cannot access a field because it is corrupt, how can I fix it in the running code? If such error occurs, I have to download the code again.

0 Kudos

821 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

I looks like compiler limitation.

But I have to clarify it with our compiler expert to be sure.

regards,

Peter

0 Kudos