Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: ARM Undefined Instruction Because BL Changes To CPSID


so I'm getting an undefined exception in an ARM microcontroller. I know why you are supposed to get those: you are loading an Instruction in memory that doesn't exist for the mode you are in (ARM or Thumb), and then you have do to the R14 minus 2 to get the instruction etc. I read the ARM ARM, but it's not helping me.

Here what I'm seeing:

The compiled instruction loaded into memory should be F7FF which corresponds to a BL but my debugger is telling me that it's B7FF which is a CPSID. The weird thing is that this does not happen every time I run through that piece of code, only some times. What could be the problem?

This is what I'm using:

  • Micro - AT91SAM7X512
  • RTOS - uVelosity 2.2.8
  • Compiler - MULTI v506

Edit (Some more notes):

R14_und = 0x2b02 every single time I hit this problem

This is what should be the memory content (when I disassemble from the binary):

But this is what it is according to the debugger:

Almost any minor change in my code "fixes" the problem.

If I change the RTOS to a newer version (2.2.9) that also "fixes" the problem.

This also only happens with some microcontrollers but not all (I have four of the exact same lot number)

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered

This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: ARM Undefined Instruction Because BL Changes To CPSID


Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription