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

control stuck in hardfault

Hi,

   We are using nrf51822 QFAAH00 with SDK 110 v8.1.0 in our project, the application will hangs or not work when control stuck at address 0x6b0 (sometimes at 0x640) programmer in debug mode, when we check the call Stack it list with  NRF_POWER_RAMONx_RAMxON_ONMODE_Msk + 0x6ad, "NRF_POWER_RAMONx_RAMxON_ONMODE_Msk " what this indicates? , CSTACK contents are zero, what is cause for this.

added following screenshot images CSTACK,Registers content after Application hang.

 

Thanks,

Nagaraj

Parents
  • FormerMember
    0 FormerMember

    First, which optimization level do you use for the code? For proper debugging using the callstack, the optimization level has to be set to '0'.

     

    Looking at the register values:

    IPSR Exception number = 0x03 : The interrupt is a hardfault

    LR = 0xFFFFFFF1   --> the hardfault comes from an interrupt

    PC = SP + 0x18 = 0x20002990 : address of the instruction that hardfaults. That instruction can be found in the .map file generated by the project. Which instruction is causing the hardfault?

    PSP: What is its value?

     

     

  • Hi,

      We Change SDK 110 v8.1.0  to SDK v10.0.0 with softdevice 8.0.0,  here also facing same issue application hangs in call stack   NRF_POWER_RAMONx_RAMxON_ONMODE_Msk + 0x6ad, and control stuck in lower address 0x6b4,

    even i try to set Optimization level  to none but result same.

    This is happening when no central Device connected to nrf51 module.

    PSP:0xFFFFFFFC

    Thanks,

    NAGARAJ

  • FormerMember
    0 FormerMember in reply to nagaraj

    Thanks!

    Could you use arm-none-eabi-addr2line.exe to find the line in the application code that results in the hardfault?

    It should be used the following way:

    arm-none-eabi-addr2line -e yourapplication.elf address 

    or

    arm-none-eabi-addr2line -e yourapplication.axf address 

Reply Children
Related