EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Undefined Instruction - 0x04

Started by strong_arm7s May 3, 2005
Hello,
After running my code in RAM debugger for nearly 6 hours it hung. I
hit stop and it was stuck on the undefined instruction 0x04 infinite
loop. Is this normal? What should it do to keep functioning and not
hang?
I am trying to find out why after a couple of minutes of running in
Flash without the debugger attached to process stops, ie. my leds stop
flashing. It either has to be an undefined instruction or a spurious
interrupt, or undefined IVR I think.
I added a Spurious ISR that just resets every thing and returns.
It just froze after 10 mins.. I am now going to add a fake ISR for all
the other IVR's in the cstartup.

Anyone with any experience with this problem??

Thanks,
Andrew



You need to have reasonable exception traps in place.

When you get a trap, you can inspect the lr register to see where the
exception occurred.

Undefined instruction generally means one of the following things:
1) If running from RAM only, then perhaps some code got overwritten.
Does not apply to flash.
2) Pointer corruption if you are using function pointers.
3) Imprope3rly handled interrupt.
4) Trashed the stack causing a return to a bogus location not containing
proper code.

> -----Original Message-----
> From: AT91SAM7@AT91...
> [mailto:AT91SAM7@AT91...] On Behalf Of strong_arm7s
> Sent: Wednesday, 4 May 2005 10:52 a.m.
> To: AT91SAM7@AT91...
> Subject: [AT91SAM7] Undefined Instruction - 0x04 > Hello,
> After running my code in RAM debugger for nearly 6 hours it hung. I
> hit stop and it was stuck on the undefined instruction 0x04 infinite
> loop. Is this normal? What should it do to keep functioning and not
> hang?
> I am trying to find out why after a couple of minutes of running in
> Flash without the debugger attached to process stops, ie. my
> leds stop
> flashing. It either has to be an undefined instruction or a spurious
> interrupt, or undefined IVR I think.
> I added a Spurious ISR that just resets every thing and
> returns. It just froze after 10 mins.. I am now going to add
> a fake ISR for all
> the other IVR's in the cstartup.
>
> Anyone with any experience with this problem??
>
> Thanks,
> Andrew >
> Yahoo! Groups Links >
>



We get the debugger to break in all the traps and then do a call dump to
see where we were when things went wrong... Usually gives you a starting
point...

-----Original Message-----
From: AT91SAM7@AT91... [mailto:AT91SAM7@AT91...] On
Behalf Of Charles Manning
Sent: Wednesday, 4 May 2005 8:37 AM
To: AT91SAM7@AT91...
Subject: RE: [AT91SAM7] Undefined Instruction - 0x04

You need to have reasonable exception traps in place.

When you get a trap, you can inspect the lr register to see where the
exception occurred.

Undefined instruction generally means one of the following things:
1) If running from RAM only, then perhaps some code got overwritten.
Does not apply to flash.
2) Pointer corruption if you are using function pointers.
3) Imprope3rly handled interrupt.
4) Trashed the stack causing a return to a bogus location not containing
proper code.

> -----Original Message-----
> From: AT91SAM7@AT91...
> [mailto:AT91SAM7@AT91...] On Behalf Of strong_arm7s
> Sent: Wednesday, 4 May 2005 10:52 a.m.
> To: AT91SAM7@AT91...
> Subject: [AT91SAM7] Undefined Instruction - 0x04 > Hello,
> After running my code in RAM debugger for nearly 6 hours it hung. I
> hit stop and it was stuck on the undefined instruction 0x04 infinite
> loop. Is this normal? What should it do to keep functioning and not
> hang?
> I am trying to find out why after a couple of minutes of running in
> Flash without the debugger attached to process stops, ie. my leds stop

> flashing. It either has to be an undefined instruction or a spurious
> interrupt, or undefined IVR I think.
> I added a Spurious ISR that just resets every thing and returns. It
> just froze after 10 mins.. I am now going to add a fake ISR for all
> the other IVR's in the cstartup.
>
> Anyone with any experience with this problem??
>
> Thanks,
> Andrew >
> Yahoo! Groups Links >
>
Yahoo! Groups Links
--
This email is confidential and intended solely for the use of the individual to whom it is addressed.
Any views or opinions presented are solely those of the author and do not necessarily represent those of NAUTRONIX LTD.

If you are not the intended recipient, you have received this email in error and use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please contact the sender.

Although our computer systems use active virus protection software, and we take various measures to reduce the risk of viruses being transmitted in e-mail messages and attachments sent from this company, we cannot guarantee that such e-mail messages and attachments are free from viruses on receipt. It is a condition of our using e-mail to correspond with you, that any and all liability on our part arising directly or indirectly out of any virus is excluded. Please ensure that you run virus checking software on all e-mail messages and attachments before reading them.


Andrew
If you can, check the LR )link register) to determine what code was
running when the undefined instruction trap was hit. It may help or
it may be in the middle of nowhere. Good luck.

Regards
-Bill Knight
R O SoftWare &
http://www.theARMPatch.com
On Tue, 03 May 2005 22:51:40 -0000, strong_arm7s wrote:

Hello,
After running my code in RAM debugger for nearly 6 hours it hung. I
hit stop and it was stuck on the undefined instruction 0x04 infinite
loop. Is this normal? What should it do to keep functioning and not
hang?
I am trying to find out why after a couple of minutes of running in
Flash without the debugger attached to process stops, ie. my leds stop
flashing. It either has to be an undefined instruction or a spurious
interrupt, or undefined IVR I think.
I added a Spurious ISR that just resets every thing and returns.
It just froze after 10 mins.. I am now going to add a fake ISR for all
the other IVR's in the cstartup.

Anyone with any experience with this problem??

Thanks,
Andrew




Memfault Beyond the Launch