Error HardFaul_Handler

07 Nov 2016

I have this Programm Sample: char BufferAsc[256]; Buffer zum Einlesen des ASC-Dokuments int ZaAs =0; Zähler-Variable2 für ASC-Dokument int ExtendedFrameFormat; Prüf-Variable für Extended-Format char IDPruefung[256]; Buffer für Prüfung der ID auf Extended-Format char ExID [256]; Buffer für ID im Extended-Format

=========================================================================================================
pc.printf("Trace_einlesen\r\n"); if(ZeilenAsc==0) { pc.printf("ZeilenASC=%d\r\n",ZeilenAsc); FILE *asc = fopen("/local/Trace.asc","r"); pc.printf("Ende einlesen\r\n"); while (fgets(BufferAsc, 256, asc) !=NULL) { printf("Line: %s\n", BufferAsc); puts (BufferAsc); ZeilenAsc=ZeilenAsc++; pc.printf("ZeilenASC=%d\r\n",ZeilenAsc); } fclose(asc);

If I start the Programm I have a HardFault_Handler in this row: while (fgets(BufferAsc, 256, asc) !=NULL)

lpc1768 Debug messages is: Stopped: VectorCatch:HardF (PC was 0x000041C0) (VectorCatch)

Debug arm-none-ebi-gdb: Program received signal SIGSTOP, Stopped (signal). HardFault_Handler () at ../mbed-src/targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_GCC_CR/startup_LPC17xx.cpp:164

Debug gdb traces is: 864,407 59^done,stack=[frame={level="0",addr="0x000000f6",func="HardFault_Handler",file="../mbed-src\ /targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_GCC_CR/startup_LPC17xx.cpp",fullname="L:
SVN
LP\ C_Workspace
RBS_Full
RBS_Light_lpc1768
mbed-src
targets
cmsis
TARGET_NXP
TARGET_LPC176X
TOOL\ CHAIN_GCC_CR
startup_LPC17xx.cpp",line="164"},frame={level="1",addr="0xfffffff9",func="<signal hand\ ler called>"},frame={level="2",addr="0x000041c0",func="memchr"},frame={level="3",addr="0x00002f22",f\ unc="_fgets_r"},frame={level="4",addr="0x00001bf8",func="main",file="../RBS_Light/main.cpp",fullname\

"L:
SVN
LPC_Workspace
RBS_Full
RBS_Light_lpc1768
RBS_Light
main.cpp",line="75"}]

864,407 (gdb) 164 AFTER_VECTORS void HardFault_Handler (void) {}

I hope someone can help me.

16 Nov 2016

I think the problem is the debug mode when I run the program directly on the hardware, I have no problem. Is it possible that the lpc1768 does not have enough power to cope with the debugg mode and read in from a text file?