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 Dejan,

    Strange. I have staerted over, and the first time I debug the build configuration that has "Enable debug options" checked, it works fine. But all other debug sessions don't. I have attached three files with the printouts from "Debug console". One file is how it looks in the build configuration that doesn't have "Enable debug options" checked. The other two has the option checked. The one where debugging is working is the first debug session, the other one is how it looks for all other debug sessions. Is it possible to find any interesting information from this?

    Has any other of your team tested to see if you can repeat this?

    What does "Enable debug options" provide?

    Best regards,
    Lars

    Reading symbols from c:/projekt\nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-objdump.exe --syms -C -h -w c:\Projekt\nordic\aws_iot\build\zephyr\merged.hex
    Reading symbols from c:/projekt/nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-nm.exe --defined-only -S -l -C -p c:\Projekt\nordic\aws_iot\build\zephyr\merged.hex
    Launching GDB: "c:\\Projekt\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gdb.exe" -q --interpreter=mi2 "c:\\Projekt\\nordic\\aws_iot\\build\\zephyr\\merged.hex"
        Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems
    Launching gdb-server: "C:\\Program Files (x86)\\SEGGER\\JLink\\JLinkGDBServerCL.exe" -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nRF9160_xxAA -select usb=960008799 -rtos "C:\\Program Files (x86)\\SEGGER\\JLink\\GDBServer\\RTOSPlugin_Zephyr.dll"
        Please check TERMINAL tab (gdb-server) for output from C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe
    Finished reading symbols from objdump: Time: 96 ms
    Finished reading symbols from nm: Time: 95 ms
    Reading symbols from c:\Projekt\nordic\aws_iot\build\zephyr\merged.hex...
    (No debugging symbols found in c:\Projekt\nordic\aws_iot\build\zephyr\merged.hex)
    WARNING: Cortex-Debug will deprecate use of GDB version 8 after July 2022. Please upgrade to version 9+
    0x00025b22 in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "c:/Projekt/nordic/aws_iot/build/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build/zephyr/zephyr.elf...
    add symbol table from file "c:/Projekt/nordic/aws_iot/build/mcuboot/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build/mcuboot/zephyr/zephyr.elf...
    add symbol table from file "c:/Projekt/nordic/aws_iot/build/spm/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build/spm/zephyr/zephyr.elf...
    2
    Resetting target
    
    Temporary breakpoint 2, main () at C:/Projekt/NordicSemi/v1.9.1/modules/hal/nordic/nrfx/hal/nrf_wdt.h:427
    427	    p_reg->RR[rr_register] = NRF_WDT_RR_VALUE;
    Reading symbols from c:/projekt\nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-objdump.exe --syms -C -h -w c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex
    Reading symbols from c:/projekt/nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-nm.exe --defined-only -S -l -C -p c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex
    Launching GDB: "c:\\Projekt\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gdb.exe" -q --interpreter=mi2 "c:\\Projekt\\nordic\\aws_iot\\build_1_enable_debug_options\\zephyr\\merged.hex"
        Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems
    Launching gdb-server: "C:\\Program Files (x86)\\SEGGER\\JLink\\JLinkGDBServerCL.exe" -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nRF9160_xxAA -select usb=960008799 -rtos "C:\\Program Files (x86)\\SEGGER\\JLink\\GDBServer\\RTOSPlugin_Zephyr.dll"
        Please check TERMINAL tab (gdb-server) for output from C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe
    Finished reading symbols from objdump: Time: 89 ms
    Finished reading symbols from nm: Time: 92 ms
    Reading symbols from c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex...
    (No debugging symbols found in c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex)
    WARNING: Cortex-Debug will deprecate use of GDB version 8 after July 2022. Please upgrade to version 9+
    0x00000438 in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/zephyr/zephyr.elf...
    add symbol table from file "c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/mcuboot/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/mcuboot/zephyr/zephyr.elf...
    add symbol table from file "c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/spm/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/spm/zephyr/zephyr.elf...
    2
    Resetting target
    [New Remote target]
    [Switching to Remote target]
    
    Thread 2 hit Temporary breakpoint 2, main () at C:/Projekt/NordicSemi/v1.9.1/modules/hal/nordic/nrfx/hal/nrf_wdt.h:427
    427	    p_reg->RR[rr_register] = NRF_WDT_RR_VALUE;
    Reading symbols from c:/projekt\nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-objdump.exe --syms -C -h -w c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex
    Reading symbols from c:/projekt/nordicsemi\v1.9.1\toolchain\opt\bin\arm-none-eabi-nm.exe --defined-only -S -l -C -p c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex
    Launching GDB: "c:\\Projekt\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gdb.exe" -q --interpreter=mi2 "c:\\Projekt\\nordic\\aws_iot\\build_1_enable_debug_options\\zephyr\\merged.hex"
        Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems
    Launching gdb-server: "C:\\Program Files (x86)\\SEGGER\\JLink\\JLinkGDBServerCL.exe" -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nRF9160_xxAA -select usb=960008799 -rtos "C:\\Program Files (x86)\\SEGGER\\JLink\\GDBServer\\RTOSPlugin_Zephyr.dll"
        Please check TERMINAL tab (gdb-server) for output from C:\Program Files (x86)\SEGGER\JLink\JLinkGDBServerCL.exe
    Finished reading symbols from objdump: Time: 81 ms
    Finished reading symbols from nm: Time: 85 ms
    Reading symbols from c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex...
    (No debugging symbols found in c:\Projekt\nordic\aws_iot\build_1_enable_debug_options\zephyr\merged.hex)
    WARNING: Cortex-Debug will deprecate use of GDB version 8 after July 2022. Please upgrade to version 9+
    0x00025b22 in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/zephyr/zephyr.elf...
    add symbol table from file "c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/mcuboot/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/mcuboot/zephyr/zephyr.elf...
    add symbol table from file "c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/spm/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from c:/Projekt/nordic/aws_iot/build_1_enable_debug_options/spm/zephyr/zephyr.elf...
    2
    Resetting target
    [New Thread 536930240]
    [New Thread 536923376]
    [New Thread 536925696]
    [Switching to Thread 536930240]
    Run to 'main' timed out. Trying to pause program

  • Hi,

    To try to come back to the previous state where debugging in some way worked, I have now uninstalled V2.0.0. But if I then try to debug aws_iot v1.9.1 I get this error message:



    Just flashing aws_iot 1.9.1 works fine, it connects and runs as it should.

    Reinstalling V2.0.0 I still get this error message for aws_iot v1.9.1. And, running aws_iot 2.0.0 I also get that error message.

    Best regards,
    Lars

  • Hi Lars,

    I have tested aws_iot sample in NCS v1.9.1 and got the same result. The debugger restriction was introduced with Cortex debug extension v1.6. The solution might be to downgrade the Cortex extension. You can do it from VS Code by going to Extensions-> Cortex Debug. Under extension name Cortex-Debug, there is Uninstall drop-down list where you can choose "Install Another Version ...".

    Best regards,
    Dejan

  • Hi Dejan,

    Great, thanks! This solves the problem to a great extent! Now it is possible to debug, but it only works every other time. It seems that I'm back to the behaviour I had in the beginning of this ticket. Which feels quite natural.

    Every other time that I debug, the board is disconnected, and then reconnected. Then debugging doesn't work.

    The other times debugging works. But this is only true if I have not checked the "Enable debug options"-checkbox when making a build configuration.

    Is it you at Nordic that are making this extension? Is there a forecast when this can be fixed?

    Best regards,
    Lars

  • Hi Lars,

    Lars M said:
    Is it you at Nordic that are making this extension? Is there a forecast when this can be fixed?

    We are not making the Cortex-Debug extension.

    Have you tried changing the board, rebooting the computer and/or replacing the cables?

    How does Ozone debugger behave now with aws_iot sample? 

    Best regards,
    Dejan

  • Hi Dejan,

    I have another DK and another cable compared to what I had in the beginning of this ticket. And my computer has been restarted several times. The version I now use of Cortex-Debug is 1.4.4. I also tested 1.4.0, but didn't see any difference.

    Debugging with Ozone works fine for hello_world if I don't check "Enable debug options". If I check it, debugging with Ozone doesn't work. For aws_iot, debugging with Ozone doesn't work at all. It feels like I'm also here is back where I was before.

    Are you able to repeat what I see? Both when it comes to this disconnection-thing with VSCode, the different behaviour when checking/not checking the "Enable debug options"-box, and what I see when trying to debug with Ozone?

    Best regards,
    Lars

Reply
  • Hi Dejan,

    I have another DK and another cable compared to what I had in the beginning of this ticket. And my computer has been restarted several times. The version I now use of Cortex-Debug is 1.4.4. I also tested 1.4.0, but didn't see any difference.

    Debugging with Ozone works fine for hello_world if I don't check "Enable debug options". If I check it, debugging with Ozone doesn't work. For aws_iot, debugging with Ozone doesn't work at all. It feels like I'm also here is back where I was before.

    Are you able to repeat what I see? Both when it comes to this disconnection-thing with VSCode, the different behaviour when checking/not checking the "Enable debug options"-box, and what I see when trying to debug with Ozone?

    Best regards,
    Lars

Children
Related