Interrupt and format error exception

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

Interrupt and format error exception

2,267 Views
Aplamon
Contributor I
Hi,

I'm trying to write a ISR in C using the __declspec(interrupt). But it seems as first time through the interrupt I get a Format Error, exception 14. Disassembling shows the start code:
0x00000000  0x4E560000               link     a6,#0
0x00000004  0x518F                   subq.l   #8,a7
0x00000006  0xF317                   fsave    (a7)
0x00000008  0x2F08                   move.l   a0,-(a7)
0x0000000A  0x2F00                   move.l   d0,-(a7)
0x0000000C  0x518F                   subq.l   #8,a7

and end code:
0x00000072  0x508F                   addq.l   #8,a7
0x00000074  0x201F                   move.l   (a7)+,d0
0x00000076  0x205F                   movea.l  (a7)+,a0
0x00000078  0xF357                   frestore  (a7)
0x0000007A  0x4E5E                   unlk     a6
0x0000007C  0x4E73                   rte     
0x0000007E  0x4E71                   nop

First off this seems to be an unbalanced stack or??
Anyone seen this? Why am I getting a format error?

Thanks,
Daniel
Labels (1)
0 Kudos
Reply
3 Replies

878 Views
Manju
Contributor I
hi Daniel,
Do u got the answer for your problem on Format error...
I'm struggling with the same error near my interrupt calling
=>void setup_handler(unsigned short vec_index,unsigned short timer)
It strck here and PC used point like the above(in the interrupt call place)..
And also this is not happening when i run the same program in my neighbour's Computer...
May i know how to rectify these errors Plz...
thanks,
Manju

0 Kudos
Reply

878 Views
Aplamon
Contributor I
No, I think it is a bug in the Codewarrior compiler. I have 6.0, I'm waiting on a chance to try it in 7.1. I worked around it by using the naked directive. Not as clean and it has a bug too, but it's one you can work around.
0 Kudos
Reply

878 Views
Manju
Contributor I
thanks Aplamon:womanhappy:,
I had a feel like when i used USB cable to connect i got lot of problem but not in parallel port...Is there anything in that or this is only my illusion?:womansurprised:
I heared that this errors are coming because of stack over flow.In PIC ide we have an option to clear the stack before debugging...
Is there any option in Code worrier to claer this stack?
or what can i do for this stack overflow problem..any idea?
i attached my errors with this for your reference...see the attachment plz..
0 Kudos
Reply