Arm Community
Site
Search
User
Site
Search
User
Support forums
Architectures and Processors forum
INVPC Hard fault exception error
Jump...
Cancel
State
Accepted Answer
+1
person also asked this
people also asked this
Locked
Locked
Replies
8 replies
Subscribers
351 subscribers
Views
18488 views
Users
0 members are here
Cortex-M3
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
INVPC Hard fault exception error
DrWhom DrWhom
over 12 years ago
Note: This was originally posted on 16th July 2009 at
http://forums.arm.com
Using and Arm Cortex M3, the application that is running sometimes will generate a hard fault and deciphering the CFSR register tells me that the following user fault is triggerred.
From the Cortex manual:
INVPC - Attempt to load EXC_RETURN into PC illegally. Invalid instruction, invalid context, invalid
value. The return PC points to the instruction that tried to set the PC.
Not sure where to proceed as the PC is pointing to the line in the exception handler. I am trying to figure out the instruction that triggerred the hard fault. Anybody have any suggestions?
Top replies
HenkvW
over 8 years ago
+1
verified
Hi, I encountered the same problem. It turned out to be a recursive call.
Parents
0
guestposter guestposter
over 12 years ago
Note: This was originally posted on 20th July 2009 at
http://forums.arm.com
Just seeing the register values at the starting of hardfault handler is not enough.
You also need to find out the register values that are pushed to the stack as
it enter hardfault handler.
The value of R4 might not mean anything. The program could have gone wrong
for a number of cycle before entering hard fault, and load this value as a literal
data accidentally. I don't know about the IAR function __iar_Tls_dtor__Isdst_rules.
Have you contact IAR support about this? They might be able to help.
Have you try to find out if IAR tool got exception event trace?
If not, define a couple of global variables that work as a shift register to record the last couple of exceptions.
This might help locate the problem.
Are you using really Process Stack?
Another possible issue is that the Main Stack Pointer and the Process Stack Pointer values are quite close.
Are you sure they haven't got overlapped by mistake?
Cancel
Vote up
0
Vote down
Cancel
Reply
0
guestposter guestposter
over 12 years ago
Note: This was originally posted on 20th July 2009 at
http://forums.arm.com
Just seeing the register values at the starting of hardfault handler is not enough.
You also need to find out the register values that are pushed to the stack as
it enter hardfault handler.
The value of R4 might not mean anything. The program could have gone wrong
for a number of cycle before entering hard fault, and load this value as a literal
data accidentally. I don't know about the IAR function __iar_Tls_dtor__Isdst_rules.
Have you contact IAR support about this? They might be able to help.
Have you try to find out if IAR tool got exception event trace?
If not, define a couple of global variables that work as a shift register to record the last couple of exceptions.
This might help locate the problem.
Are you using really Process Stack?
Another possible issue is that the Main Stack Pointer and the Process Stack Pointer values are quite close.
Are you sure they haven't got overlapped by mistake?
Cancel
Vote up
0
Vote down
Cancel
Children
No data