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,

    As can be seen in debugging application, ENABLE_DEBUG_OPTIONS sets the following in the prj.conf
    CONFIG_DEBUG_OPTIMIZATIONS=y
    CONFIG_DEBUG_THREAD_INFO=y

    Best regards,
    Dejan

Reply Children
No Data
Related