Stack issue
2005-06-30 by keithgw_strider
I have seen the following on the LPC2131 and LPC2138:
It appears anytime the PC and SP are equal except for the high byte of
the address, and you run a POP {R4} instruction, the chip will pop two
times off the stack thus loading R4 with the wrong value and messing
up your stack.
for example:
0x000001F4 POP {R4} With SP = 0x400001F4.
R4 will be loaded with the contents of 0x400001F8.
This problem has been verified by IAR on the LPC213x family, but they
could not get it to happen on the LPC2106.
If anyone is having bizzare stack problems, see if this might be the
cause.