Content originally posted in LPCWare by micrio on Mon Apr 12 06:37:52 MST 2010
I have been having a HardFault occur every time I debug my app. My app works perfectly if I power cycle my target but then I can't controll it with LPCXpresso. So it seems that the code is good.
Per recomendations here I tried the most basic of apps with the default environment. So I created a new workspace and project. I ran "Create NXP LPC1100 Project". When I debug it I still drop into the HardFault handler. The only change that I made to the default source was to select the internal RC osc as the clock source. This is what I changed;
[LEFT][COLOR=#3f7f5f][COLOR=#3f7f5f]//#define SYSPLLCLKSEL_Val 0x00000001 // Uses external [U]osc[/U].[/COLOR][/COLOR][/LEFT]
[B][COLOR=#7f0055][COLOR=#7f0055]#define [/COLOR][/COLOR][/B]SYSPLLCLKSEL_Val 0x00000000 [COLOR=#3f7f5f][COLOR=#3f7f5f]// Use internal RC [U]osc[/U].[/COLOR][/COLOR]
[LEFT]LPC_SYSCON->[COLOR=#0000c0][COLOR=#0000c0]SYSPLLCLKSEL[/COLOR][/COLOR] = SYSPLLCLKSEL_Val;[/LEFT]
[LEFT]I have included a screen shot. This shows the registers and the contents of the stack.
Is there any guide on how to read the stack frame?[/LEFT]
[LEFT]Is there any assembly opcode that I can add that causes the code to break into the debugger? I could use this to enter the debugger earlier than is possible now. I never get to the breakpoint at "main".[/LEFT]