AnsweredAssumed Answered

register storing/loading problem in interrupt handling functions

Question asked by Jan Floder on Jan 11, 2010
Latest reply on Jan 13, 2010 by Jan Floder

Hi,

 

While developing a program for a Coldifre 5212 microcontroller I noticed strange behavior of the prog. After some investigation I found that interrupt handling functions do not store all registers which are used inside the interrupt. They store registers used in the functions themselves  but ignore all registers used in functions called inside the interrupts. This corrupts code execution.

In the forum I have found no working solution.

1) pragmas NO_ENTRY, NO_EXIT etc. do not work in CW at all.

2) I wrote an interrupt handler in assembler and manually stored/loaded all registers (except a7 and a6 in case of a6 stack frames :smileyhappy: ) but there is a problem with A6 stack frames checkbox (each situation needs different instructions and handling). I cannot find out how to check actual value of a6frames checkbox and compile corresponding code lines.

 

Does anyone know how to solve this problem (rewrite interrupt handlers not to call any function is not possible) and force compiler store all (desired) registers in interrupt handlers? 

Outcomes