This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ILLOPA exception on C167CR-LM

Hello,
I developed an emmbedded application for a C167CR-LM.
In this application I've some very big data structures stored in internal RAM (IDATA) and some dynamic list managed using malloc and free.
For dynamic allocation I define the pool:

unsigned char far equivalence_pool[0x4000];

init_mempool (equivalence_pool, sizeof (equivalence_pool));

In my application there is a IRQ routine on a Timer T6 with a period of 0.5 ms.

In some situations the ILLOPA exception is trapped an the application crashes.
It generally happens when many digital input (linked to port P2 pins) are active together.

I tried to increase the user stack with no effect.

Adding 2 calls to printf in the IRQ routine, ILLOPA is not generated.

Have you some suggestions for help me how to investigate this problem?

Testing with Mon166 the trap routines are not available, and using Simulator is too complex cause the hardware and input sequences to generate.

Thanks,
Marco

Parents
  • That ISR is very seriously broken. It is many, many, many times too large and tries to do things a 0.5ms ISR should not try to do.

    Do split your code into ISR to collect events and a main loop that process the events. Your ISR shouldn't be larger than what you can view at the same time without selecting a microscopic font.

    How have you made sure that for any sequence of input stimuli, your ISR manages to do all work in 0.5ms? If y ou can't guarantee that - why even bother to have the code in the ISR if it isn't critical enough that it _must_ be done within 0.5ms?

Reply
  • That ISR is very seriously broken. It is many, many, many times too large and tries to do things a 0.5ms ISR should not try to do.

    Do split your code into ISR to collect events and a main loop that process the events. Your ISR shouldn't be larger than what you can view at the same time without selecting a microscopic font.

    How have you made sure that for any sequence of input stimuli, your ISR manages to do all work in 0.5ms? If y ou can't guarantee that - why even bother to have the code in the ISR if it isn't critical enough that it _must_ be done within 0.5ms?

Children