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
  • In the startup script i have to replace "_start" with "main", see below:

    ldr r1, =__etext ldr r2, =data_start ldr r3, =data_end

    subs    r3, r2
    ble     .LC0
    

    .LC1: subs r3, 4 ldr r0, [r1,r3] str r0, [r2,r3] bgt .LC1 .LC0:

    LDR     R0, =SystemInit
    BLX     R0
    LDR     R0, =main
    BX      R0
    

    If i don't replace "_start" with "main", the eval board went at this point to the Hardfault handler.

Reply
  • In the startup script i have to replace "_start" with "main", see below:

    ldr r1, =__etext ldr r2, =data_start ldr r3, =data_end

    subs    r3, r2
    ble     .LC0
    

    .LC1: subs r3, 4 ldr r0, [r1,r3] str r0, [r2,r3] bgt .LC1 .LC0:

    LDR     R0, =SystemInit
    BLX     R0
    LDR     R0, =main
    BX      R0
    

    If i don't replace "_start" with "main", the eval board went at this point to the Hardfault handler.

Children
Related