Arm Community
Site
Search
User
Site
Search
User
Support forums
Architectures and Processors forum
hard fault with Cortex M1
Jump...
Cancel
State
Not Answered
Locked
Locked
Replies
10 replies
Subscribers
348 subscribers
Views
11817 views
Users
0 members are here
Cortex-M1
Cortex-M
firmware
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
hard fault with Cortex M1
sumit sumit
over 12 years ago
Note: This was originally posted on 24th December 2008 at
http://forums.arm.com
Hi all,
I am developing firmware on Cortex M1 on Actel fusion FPGA.I have built the design that has sram at 0x0 location ,size is 1mb and I use it as my program memory.I have Ethernet interface and I want to debug the driver for the ipcore.
I am facing the problem due to hard fault.When I start the transmission on the Ethernet,after transmission first frame the cortex goes to hard fault.
Would anyone tell me what may be the reason for hard fault? How to overcome?
I am completely new to arm environment.
regards,
Sumit
Parents
0
guestposter guestposter
over 12 years ago
Note: This was originally posted on 8th December 2009 at
http://forums.arm.com
Not sure if it help, there are various things you might need to check.
First, please check if the FPGA image you are using contains the OS support.
(On Cortex-M1 OS support hardware is optional).
What might have happen is that :
- you created your stack frame in the stack
(Is the content of the stack frame correct?
If the stack frame aligned to double word address?)
- you set your process stack pointer (PSP) to point to the beginning of this stack frame
(Did you update PSP correctly?
Did you take account of the requirement of double word alignment?
Does the PSP really pointing to the correct address in the stack frame?)
- You carry out an exception return, LR specifying using PSP for unstacking.
(did LR set to correct value?)
- The exception return load the stack frame contents into registers.
If the PSP location is wrong, the processor loaded in incorrect values.
This include the 0xa5a5a5a5 loading into PC. Since this is not a valid location
for program code, the hard fault is triggered when it try to fetch instruction.
- At hard fault exception entry, the value 0xa5a5a5a5 is pushed to the stack as return address.
regards,
Joseph
Cancel
Vote up
0
Vote down
Cancel
Reply
0
guestposter guestposter
over 12 years ago
Note: This was originally posted on 8th December 2009 at
http://forums.arm.com
Not sure if it help, there are various things you might need to check.
First, please check if the FPGA image you are using contains the OS support.
(On Cortex-M1 OS support hardware is optional).
What might have happen is that :
- you created your stack frame in the stack
(Is the content of the stack frame correct?
If the stack frame aligned to double word address?)
- you set your process stack pointer (PSP) to point to the beginning of this stack frame
(Did you update PSP correctly?
Did you take account of the requirement of double word alignment?
Does the PSP really pointing to the correct address in the stack frame?)
- You carry out an exception return, LR specifying using PSP for unstacking.
(did LR set to correct value?)
- The exception return load the stack frame contents into registers.
If the PSP location is wrong, the processor loaded in incorrect values.
This include the 0xa5a5a5a5 loading into PC. Since this is not a valid location
for program code, the hard fault is triggered when it try to fetch instruction.
- At hard fault exception entry, the value 0xa5a5a5a5 is pushed to the stack as return address.
regards,
Joseph
Cancel
Vote up
0
Vote down
Cancel
Children
No data