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

Exit from debug mode

Hello,

I did some power measurement on the nrf52 DK with the Nordic profiler kit and the result was way more than what we could expect from a nrf52 (about 1 mA). Even in power off mode, it still needs about this amount of current.

After a search on the devzone, I discovered that it could be because the nrf52 is in debug mode. In this mode, the nrf52 never goes on power down mode et consume way more than in normal mode.

I tried to power reset the chip in order to enter normal mode. But I didn't work.

I also tried nrfjprog --pinreset, but it didn't change anything either.

Finally, I saw on that thread that the code to know whether the debug mode is enabled or not is :

if (DWT->CYCCNT != 0) { bsp_board_led_on(LED); }

And the LED is always on when I run this code.

Is there a solution to exit the debug mode ?

Parents
  • Hello, thank you for this answer. I tried it but unfortunately, it didn't work.

    I did a couple of tests to be more precise about my issue.

    First of all, I discovered that when I press the reset button, It works when the Profiler kit is unplugged but not when it is plugged.

    Secondly, I am not sure if this problem is linked to debug mode or another issue. I found the codeif (DWT->CYCCNT != 0) { bsp_board_led_on(LED); } on the devzone but I am not actually sure whether this is the right way of doing it or not.

    To be sure of the problem, I installed the latest version of the SDK (14.0.0) and I flashed the S132 (5.0.0) to the nrf52 DK. Then I flashed the ble_app_hrs example. I opened the profiler kit sotfware and I have an average consumption of about 1 mA :

    image description

    And when I am in power off mode, the average consumption is about 700 uA :

    image description

    I think these values are far away from what it should be, but it could be linked to another problem.

  • I tried it both on the nRF52832 DK and the nRF52840 Preview DK but the result is the same.

    I also found on the header file components\libraries\util\app_util_platform.h a macro named NRF_BREAKPOINT_COND and the code if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) to determinate whether the debugger is connected or not. I tried it on the main function but it never goes inside the if statement.

    Do you need more information? Do you have maybe some code I can try to determinate more precisely the problem?

    By the way, I am using arm GCC but I can try to run the example on Keil if that could help.

    Thank you for your help

Reply
  • I tried it both on the nRF52832 DK and the nRF52840 Preview DK but the result is the same.

    I also found on the header file components\libraries\util\app_util_platform.h a macro named NRF_BREAKPOINT_COND and the code if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) to determinate whether the debugger is connected or not. I tried it on the main function but it never goes inside the if statement.

    Do you need more information? Do you have maybe some code I can try to determinate more precisely the problem?

    By the way, I am using arm GCC but I can try to run the example on Keil if that could help.

    Thank you for your help

Children
No Data
Related