This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

HRM failure HardFault_Handler

Hello,

i try to get HRM example to work with eclipse. I can compile the project with GCC in eclipse and flash it to the PCA10001 eval board. I can find the HRM with the Master Controlo Panel. Then i select the device and discover all services. Up to here works allers great. But after all the services listed in the master control panel following is written in log:

[13:52:23.0] Received Read Response, handle: 0x0018, value (0x): 4E-6F-72-64-69-63-53-65-6D-69-63-6F-6E-64-75-63-74-6F-72 [13:52:23.0] Service Discovery complete [13:52:26.5] Lost connection to device. Reason: BTLE_CONNECTION_TIMEOUT [13:52:26.5] SERVER: Received packet <HciEvent: eventCode=0x0A> - <HciEvent: eventCode=0x0A> [13:52:26.5] SERVER: Received Link Loss

In the debugger call stack from PCA10001 board i can see that the program is in the HardFault_Handler. Call Stack: Thread [1] (Suspended : Signal : SIGTRAP:Trace/breakpoint trap) HardFault_Handler() at gcc_startup_nrf51.s:173 0x1bb06 0x11cb4 0x11cb4

Is the address 0x11b4 in softdevice? Is here an undefined interrupt call?

I also try the HRM example with Keil Toolchain. With Keil all works greate. But i can't find the differnt between eclipse and keil.

Parents
  • It only happened in my own project.

    But now i have found the solution :-)

    in my Makefile, the order of LDFLAGS was as follows: -L"$(COMPILER_BASE)/arm-none-eabi/lib/armv6-m/" -L"$(COMPILER_BASE)/lib/gcc/arm-none-eabi/4.7.4/armv6-m/" -mcpu=cortex-m0 -mthumb -mabi=aapcs -Xlinker -Map=$(OUTPUT_LST_DIR)/$(PROJECT_NAME).map

    With this order, the linker takes the thumb standard library and not ARMv6-m libraries. It now works with the following settings: -L"$(COMPILER_BASE)/arm-none-eabi/lib/armv6-m/" -L"$(COMPILER_BASE)/lib/gcc/arm-none-eabi/4.7.4/armv6-m/" -Xlinker -Map=$(OUTPUT_LST_DIR)/$(PROJECT_NAME).map -mcpu=cortex-m0 -mthumb -mabi=aapcs

    Thank you for your help :-)

Reply
  • It only happened in my own project.

    But now i have found the solution :-)

    in my Makefile, the order of LDFLAGS was as follows: -L"$(COMPILER_BASE)/arm-none-eabi/lib/armv6-m/" -L"$(COMPILER_BASE)/lib/gcc/arm-none-eabi/4.7.4/armv6-m/" -mcpu=cortex-m0 -mthumb -mabi=aapcs -Xlinker -Map=$(OUTPUT_LST_DIR)/$(PROJECT_NAME).map

    With this order, the linker takes the thumb standard library and not ARMv6-m libraries. It now works with the following settings: -L"$(COMPILER_BASE)/arm-none-eabi/lib/armv6-m/" -L"$(COMPILER_BASE)/lib/gcc/arm-none-eabi/4.7.4/armv6-m/" -Xlinker -Map=$(OUTPUT_LST_DIR)/$(PROJECT_NAME).map -mcpu=cortex-m0 -mthumb -mabi=aapcs

    Thank you for your help :-)

Children
Related