Nordic nrf51xxx Hardfault on SystemInit()

Sysprogs forums Forums VisualGDB Nordic nrf51xxx Hardfault on SystemInit()

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7280

    Hello,

    I purchased a new noridc PCA10028 development board. In Visual GDB I selected “nRF51422_XXAC” “S110” or “S130, Newlib-nano, Bluetooth Heartrate Device or Bluetooth UART.

    When starting to debug, when calling SystemInit() the HeartFault-Handler is hit.

    It happens after returning from is_manual_peripheral_setup_needed() or is_disabled_in_debug_needed(). I tried to uncomment both but then after SystemInit(); __libc_init_Array() is called and it also jumps into Hardfault-Handler. After also uncommenting __libc_init_Array(); Hardfault-Handler is hit in main() on timers_init();

    Nordic Board: PCA10028 V1.1.0 2015.44

    VisualGDB Linux Edition Version 5.0 Support period expires on 2016-02-25

    Any suggestions?

     

     

     

     

    #7281
    support
    Keymaster

    Hi,

    That usually happens when the stack pointer points to an invalid location. Please double-check your MCU type. You can also try using the Memory window to edit the memory at the $sp address to see if the memory there is writable. If you find out that it’s not writable, please change the MCU type to a one with a smaller RAM.

    #7284

    Hello,

    I checked again, on the PCA10028 normally a NRF51422 xxAC is used. That’s also what is on top of the IC-case N51422-OCAC1-1515AK, SEGGER J-Link Control Panel also Displays NRF51422_XXAC as connected device.

    I tried the AA-Version with lower RAM, but here also right after returning from any called function the core jumps to the HardFault Handler. I also tried different Settings for “C Library Type”, “Reduce sice of C++ Binaries” and “Provide Default stubs for system calls” I also tried S130 or S110 as Softdevice with both HeartRatePeripheral and UART, but all behave the same.

    When using mbed I can Flash the Chip via Bootloader-Device, the code runs. But J-Link ODB is lost after that. It needs to be reflashed with the Nordic J-Link ODB Firmware to get J-Link functionality again.

    #7291
    support
    Keymaster

    Hi,

    Do you have the “Reset device after programming” flag enabled in the Debug Settings as described in the tutorial?

    #7307

    Hello,

    no, that was the case, I didn’t set the flag…

    After setting it all worked just perfectly, thank you

    #7316
    support
    Keymaster

    Hi,

    No problem. BTW, we have released an update to the Segger J-Link package that will set the flag automatically for new Nordic projects. Feel free to update it via Tools->Embedded Tools Manager.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.