Problems with "Enable debug options"

Hi,

I am facing a problem with the selection "Enable debug options" when creating a build configuration. I use nRF connect SDK 1.9.1 with VSCode. I create an application from sample aws_iot. Then I make two different build configurations, one with "Enable debug options" checked, and one with the option unchecked. The one that has debug option enabled is not possible to debug (it may work once, but all other debug sessions do not work). But the one that doesn't have the option enabled works fine to debug.

How come there is a difference?

What does "Enable debug options" provide?

Best regards,
Lars

Parents
  • Hi,

    I have replicated the scenario you described myself using aws_iot sample with VS Code and NCS v1.9.1. I did not observe any issue, no matter if "Enable debug options" was checked or unchecked, .

    Best regards,
    Dejan

  • Hi Dejans, Lars. 

    I also have exactly the same symptoms as Lars, with the Enable debug options checked the debug is non-functional, (AKA useless). 

    I am using 

    SDK 2.1.0

    nrf Debug 

    asset_tracker_v2 with aws_iot enabled. 

    turning off the debug option in build allows me to start / restart / stop with the debug toolbar, but the breakpoints are all over the place, probably because the build is optimised? 

    Any suggestions as to resolution on this would be appreciated. 

    Regards

    Marshall

  • Hi,

    I have recently used the nRF debugger with NCS v2.1.0. While using nRF Debug I have not noticed issues with breakpoints that were previously reported.

    Best regards,
    Dejan

  • Hi,

    Recent release should have solved problem with breakpoints. Build optimizations will still prevent setting breakpoints on lines that don't exist in the final build. This is part of the built-in functionality in Microsoft's debugger backend and is added to avoid unexpected behavior with some corner cases.

    Best regards,
    Dejan

  • Hi,

    Ok, I'll test it when I get some time.

    Best regards,

    Lars

  • Hi,

    Lars M said:
    Ok, I'll test it when I get some time.

    When you complete testing, I would appreciate it if you could provide testing results.

    Best regards,
    Dejan

  • Hi Dejan,
    Now I have installed NCS 2.2.0, created and example with aws_iot and added two build configurations (one with debug options enabled and one with debug options disabled). The one with debug options disabled works as before. When the debug session starts, it halts in file nrf_wdt.h on the row shown in the picture below:



    A breakpoint on the first row in main() will be hit after pressing F5.

    The build configuration with debug options enabled will halt in file fault_s.S on the row shown in the picture below:



    Feels strange that the files differ, and starting in fault_s.S doesnt't feel good. But pressing F5 will make the breakpoint in main() to be hit, and the debugging seems to work fine. But if I click the restart-button (ctrl+shift+F5), things just stop and the debugging doesn't restart. Then it is necessary to start a new debug session.

    If I add a breakpoint on the row where the debug session with debug options disabled starts (in nrf_wdt.h), things don't work either. The debug session starts as before in file fault_s.S, but after pressing F5 nothing happens.

    Can you repeat this?

    Best regards,
    Lars

Reply
  • Hi Dejan,
    Now I have installed NCS 2.2.0, created and example with aws_iot and added two build configurations (one with debug options enabled and one with debug options disabled). The one with debug options disabled works as before. When the debug session starts, it halts in file nrf_wdt.h on the row shown in the picture below:



    A breakpoint on the first row in main() will be hit after pressing F5.

    The build configuration with debug options enabled will halt in file fault_s.S on the row shown in the picture below:



    Feels strange that the files differ, and starting in fault_s.S doesnt't feel good. But pressing F5 will make the breakpoint in main() to be hit, and the debugging seems to work fine. But if I click the restart-button (ctrl+shift+F5), things just stop and the debugging doesn't restart. Then it is necessary to start a new debug session.

    If I add a breakpoint on the row where the debug session with debug options disabled starts (in nrf_wdt.h), things don't work either. The debug session starts as before in file fault_s.S, but after pressing F5 nothing happens.

    Can you repeat this?

    Best regards,
    Lars

Children
Related