HardFault_Handler on ble_srv_report_ref_encode

Hi,

I have some trouble when I want to debug my code, I use GCC and I have this :

HardFault_Handler () at ../libs/nRF5_SDK/modules/nrfx/mdk/gcc_startup_nrf52820.S:302

302     b       .

I pass HARDFAULT_HANDLER_ENABLED to 1 to have more information on what is the problem and this appear : 

0x0002b776 in ble_srv_report_ref_encode (p_encoded_buffer=0x20002618 <impure_data+72> "", p_report_ref=0x0) at ../libs/nRF5_SDK/components/ble/common/ble_srv_common.c:68

68     p_encoded_buffer[len++] = p_report_ref->report_id;

How I can handle this case ?

Parents
  • You need to check the function call stack that caused this. Start your app in the debugger mode and put the breakpoint at the line/instruction which the hardfault handler showed you in the logs. 

    Run the app again until you hit the breakpoint (without executing the instruction that caused hardfault) and see the call stack to get more context on when and why this is happening.

Reply
  • You need to check the function call stack that caused this. Start your app in the debugger mode and put the breakpoint at the line/instruction which the hardfault handler showed you in the logs. 

    Run the app again until you hit the breakpoint (without executing the instruction that caused hardfault) and see the call stack to get more context on when and why this is happening.

Children
No Data
Related