We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi. I have an INVPC exception that I am trying to debug on a Cortex M4 STM32. The stack contains the following values:
0x08003555 xPSR0x08006824 PC0x08006824 LR0x00000000 R120x08003341 R30x08006824 R20xFFFFFFFD R20x0000FFFF R0
The PC and LR both point to an address just beyond the end of the used flash memory, specifically this:
Region$$Table$$Base 0x08006804: 08006824 $h.. DCD 134244388 0x08006808: 20000000 ... DCD 536870912 0x0800680c: 000000bc .... DCD 188 0x08006810: 08005b30 0[.. DCD 134241072 0x08006814: 080068e0 .h.. DCD 134244576 0x08006818: 200000bc ... DCD 536871100 0x0800681c: 00001a34 4... DCD 6708 0x08006820: 08005b40 @[.. DCD 134241088 Region$$Table$$Limit
Everything after that in the list file is RAM data, debugging info etc.
Firstly I don't understand why this has caused an INVPC exception, because although the data at this address probably isn't a valid op-code it is a valid address to jump to. It's within flash memory and 32 bit aligned.
Secondly I want to figure out what caused this exception, but I'm not sure how to do it. I can't even reproduce it on demand at the moment, I have to run the system for a day or two before it happens.
Diassembly of the data at 0x08006824:
It seems like nonsense, maybe data interpreted as code or something.