HardFault Handler Help

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HardFault Handler Help

724 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Thu Oct 04 07:15:25 MST 2012
Hi,

I'm debugging a program on LPC1347 and I get a HF. I added debugging code to the handler() per RedCode http://support.code-red-tech.com/CodeRedWiki/DebugHardFault The forum won't let me post that much text in this post so I have a .zip .doc attached with the info. The output when I get the crash looks like this:

[LEFT][FONT=Times New Roman]r0 0x10001a34[/FONT]
[FONT=Times New Roman]r1 0xffffffff[/FONT]
[FONT=Times New Roman]r2 0xfffffffe[/FONT]
[FONT=Times New Roman]r3 0xc0000000[/FONT]
[FONT=Times New Roman]r4 0x10001030[/FONT]
[FONT=Times New Roman]r5 0x10001120[/FONT]
[FONT=Times New Roman]r6 0xc[/FONT]
[FONT=Times New Roman]r7 0x3[/FONT]
[FONT=Times New Roman]r8-r11 0[/FONT]
[FONT=Times New Roman]r12 0x40[/FONT]
[FONT=Times New Roman]sp 0x10001f28[/FONT]
[FONT=Times New Roman]lr 0xfffffff1[/FONT]
[FONT=Times New Roman]pc 0x00000228[/FONT]
[FONT=Times New Roman]PSR 0xa1000003[/FONT]
[FONT=Times New Roman]Flags NzCvq[/FONT]
[FONT=Times New Roman]ESPSR none[/FONT]
[FONT=Times New Roman]IPSR 3 (HardFault)[/FONT]
[FONT=Times New Roman]PSP 0[/FONT]
[FONT=Times New Roman]CONTROL Priviledged/MSP (AtBase)[/FONT]
[FONT=Times New Roman]Cycle 0x180f2745[/FONT]
[FONT=Times New Roman]CycleDelta 0x180f0725[/FONT]
[FONT=Times New Roman]VECTPC 0x1fff3848[/FONT]
[FONT=Times New Roman]CSFR 0x8200[/FONT]
[FONT=Times New Roman]Faults PreciseErr[/FONT]
[FONT=Times New Roman]BFAR 0xffffffff[/FONT][/LEFT]

[LEFT][FONT=Times New Roman]What is this information telling me? I know that there is no address 0x1fff3848 so I don't understand what VECTPC is saying here. Is this a stack overflow condition?[/FONT][/LEFT]

[LEFT][FONT=Times New Roman]Thanks![/FONT][/LEFT]
0 Kudos
Reply
1 Reply

670 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Thu Oct 04 11:00:24 MST 2012
[FONT=Tahoma][SIZE=1]In short, what these numbers mean is that your code tried to jump or call something at 0x1FFF3848 (where as you say there is no code). :(

The 1FFF.... part makes me think you are trying to call ROM routines -- does this part have USB ROM drivers or similar.

Try looking at the stack in a memory view (in the case you show) from 0x10001f28 upwards to see if you can recognise a return address into the code you did write to see where the bad call/jump is originated. The map file is your friend here.

Regards -- Keep On Coding -- Mike[/SIZE][/FONT][FONT=Times New Roman][FONT=Tahoma]
[/FONT]
[/FONT]
0 Kudos
Reply