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

Debug mode is not working in Segger Embedded Studio?

We are using nRf52840 chip with Nordic SDK 15.0 version using SES IDE. When we use debug mode in build configurations program is not working or not debugging got error as a unknown function and stop running in below function:

void idle_state_handle(void) {
  if (NRF_LOG_PROCESS() == false) {
    nrf_pwr_mgmt_run();
  }
}

But when we select release mode the program is working fine. But we want to debug our code with break points, so will you please give me solution why program is not working in debug mode. Is any other setting that we need to configure in segger embedded studio for debugging. 

Thanks in advanced.......

Parents Reply
  • Hi,

    The program appears to have entered the hardfault exception handler inside the MBR. It's normally forwarded to the main application, but will get trapped if breakpoint on hardfault is enabled in SES. Make sure you have this breakpoint disabled in the breakpoints view.

    Breakpoints window. Start a debug session and use Ctrl+Alt+b to open view. 

    This should ensure that the hardfault exception is forwarded to the application. Then you can use the HardFault handling library to determine if the fault was indeed caused by NRF_LOG_PROCESS.

Children
  • Thanks for replay...

    I have disabled all breakpoints and also disabled HardFault break point as attached following image:

    But my application is not actually running not BLE adverting, Not showing all LOGS.

    Will you please help me or provide step for How i implement   HardFault handling library  in my application to determine if the fault was indeed caused by NRF_LOG_PROCESS.

    Thanks...!!

  • You need to halt the CPU to see where the program is stuck. It's probably going to be in the hardfault handler. 

    vishal said:
    Will you please help me or provide step for How i implement   HardFault handling library  in my application to determine if the fault was indeed caused by NRF_LOG_PROCESS.

    Did you include hardfault_implementation.c and hardfault_handler_gcc.c from \components\libraries\hardfault in your project? You also need to enabled the hardfault handler in sdk_config.h

  • When i added this libraries into my project and enabled hardfault handler in sdk_config.h the got error like

    <error> hardfault: HARD FAULT at 0x000273AA
    <error> hardfault:   R0:  0x00140101  R1:  0x00000000  R2:  0x00000001  R3:  0x02FE2B00
    000000
    ult).
    <error> hardfault: Bus Fault Address: 0x02FE2B04
    

    Will you please tell me why this error coming where is exactly issue..

     Thanks.. 

  • Sorry for the late response. Did you manage to fix this? If not, the log indicates that the fault occurred at address 0x273AA so you should try lookup this address in the "disassembly" view to find the code section that leads to the hardfault. 

  • Sorry for late response,

    We were busy to implement other functionality and used segger setting in release mode. But now we need to resolve this issue still getting.

    But currently ERROR got as per below:

    <error> app: ERROR 3735928559 [Unknown error code] at D:/Permanent_monitoring_system/nRF5_SDK_15.0.0_a53641a/modules/nrfx/hal/nrf_gpio.h:455
    PC at: 0x00032ECB
    <error> app: End of error report

    When i go to line no 455 in nrf_gpio.h the saw   NRFX_ASSERT(*p_pin < NUMBER_OF_PINS);

    Why my program stuck here in debug mode.

    Will please provide best solution to resolve this debug issue.

    Looking forward your response..!!!

Related