how to config NCS + VS code + openOCD + cortex-debug ?

As mentioned in subject,I try to study course with CMSIS-DAP,now, chip recove and flash is OK,but blocked at debug step for 2 days now.

Maybe I made some wrong config some where,current error is so obvious: NCS try to flash with nrfutil after "debug" pressed though launch.jos has been binded.

I have looked through whole project space, can't figure it out.

VS code : 1.118.1

nrf Connect: most updated(auto update )

cortex-debug: most updated

openOCD:most updated

debug launch.json(don't care the contents):

{
  "version": "0.2.0",
  "configurations": [
    {
      "cwd": "${workspaceRoot}",
      "executable": "./bin/executable.elf",
      "name": "Debug with OpenOCD",
      "request": "launch",
      "type": "cortex-debug",
      "servertype": "openocd",
      "configFiles": [
        "cmsis-dap.cfg",
        "nrf52.cfg"
      ],
      "searchDir": [],
      "runToEntryPoint": "main",
      "showDevDebugOutput": "none"
    },

    {
      "name": "nRF52 cortex-debug",
      "type": "cortex-debug",
      "request": "launch",
      "servertype": "openocd",
      //"debugServer": 4711,
      "openOCDPreConfigLaunchCommands": [
        "-c", "gdb port 4444",
        "-c", "tcl port 4445",
        "-c", "telnet port 4446"
      ],
      "cwd":"${workspaceFolder}", 
      "configFiles": [
        "cmsis-dap.cfg",
        "nrf52.cfg"
      ],
      "device": "nRF52810",
      "svdFile": "nrf52810.svd",
      "executable": "build/merged.hex",
      "preLaunchCommands": [
        "monitor program ${executable}",  // 烧录ELF文件
        "monitor verify",                 // 验证烧录内容
        "monitor reset"                   // 复位芯片
      ],
      "armToolchainPath": "d:/ncs/arm-gnu-toolchain-15/bin",
      "gdbPath": "d:/ncs/arm-gnu-toolchain-15/bin/arm-none-eabi-gdb",
      "gdbTarget": "localhost:4444",
      "showDevDebugOutput": "both"
    }
  ]
}

NCS created binds:

{
/*
    "cortex-debug.liveWatchRefreshRate": 300,
    "cortex-debug.armToolchainPath": "D:/ncs/arm-gnu-toolchain-15/bin",
    "cortex-debug.gdbPath": "D:/ncs/arm-gnu-toolchain-15/bin",
    "cortex-debug.openocdPath": "D:/ncs/openocd/bin",
*/
    "nrf-connect.flashOnDebug": false,

    "nrf-connect.taskBindings": {   
        "flash": [
            {
                "taskName": "flash merged firmware",
                "buildConfigs": [
                    "${workspaceFolder}\\build"
                ]
            }
        ]
    },
    "nrf-connect.debugging.bindings": {
        "${workspaceFolder}/build": "Debug with OpenOCD"
    }
}

After pressed the "debug"(insert does not work,so, plain text):

* Executing task: nRF Connect: Flash: l1_e2/build/l1_e2

Flashing l1_e2 to B001A000000
west flash -d d:\ncs\myfw\ncsfund\l1_e2\build --domain l1_e2 --no-reset --dev-id B001A000000

-- west flash: rebuilding
[0/5] Performing build step for 'l1_e2'
ninja: no work to do.
[2/5] No install step for 'l1_e2'
[3/5] Completed 'l1_e2'
[4/5] C:\WINDOWS\system32\cmd.exe /C "cd /D D:\ncs\myfw\ncsfund\l1_e2\build\_sysbuild && D:\ncs\toolchains\936afb6332\opt\bin\cmake.exe -E true"
-- west flash: using runner nrfutil
-- runners.nrfutil: Flashing file: D:\ncs\myfw\ncsfund\l1_e2\build\merged.hex
Error: No devices with requested serial number(s) or trait(s) found
FATAL ERROR: command exited with status 1: nrfutil --json device x-execute-batch --batch-path 'D:\ncs\myfw\ncsfund\l1_e2\build\l1_e2\zephyr\generated_nrfutil_batch.json' --serial-number B001A000000

* The terminal process terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

the launch name has been displayed beside the "debug", the launch.json will displayed if you press the gear button。

It worked once before: the script runs if debug button pressed, though did not success,but now it completely ignore the launch.json.

The base target: debug with CMSIS-DAP .

It will be very helpful to provide guides on configuration.

Thank you.

  • Hi, 

    Your settings.json has "nrf-connect.flashOnDebug": false, but note that the correct setting key in newer versions is "nrf-connect.debugging.flash" See nrf-connect.debugging.flash

    Regards,
    Amanda H.

  • tried again: re-create blinky following Exercise 1.

    build success.

    create task to burn firmware,success.

    {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "tasks": [
        {
    		"label": "flash merged firmware",
    		"group": "none",
    		"type": "shell",
            "command": "openocd",
            "args": [
                "-s", "d:/ncs/openocd/openocd/scripts/",
                "-f", "interface/cmsis-dap.cfg",    // 适配器驱动配置
                "-c", "transport select swd",       // 传输协议选择
                "-f", "target/nordic/nrf52.cfg",    // 目标芯片配置
                "-c", "program build/merged.hex preverify verify reset exit 0"
            ]
        }
    ]
    }

    create launch.json to debug.

    Add configuration -> openOCD(Debug with OpenOCD):

    {
    	"version": "0.2.0",
    	"configurations": [
    		{
    			"cwd": "${workspaceRoot}",
    			"executable": "./build/blinky/zephyr/zephyr.elf",
    			"name": "Debug with OpenOCD",
    			"request": "launch",
    			"type": "cortex-debug",
    			"servertype": "openocd",
    			"configFiles": ["./dapNrf52.cfg"],
    			"searchDir": ["d:/ncs/openocd/openocd/scripts/"],
    			"runToEntryPoint": "main",
    			"showDevDebugOutput": "both"
    		},
    		{
    			"type": "nrf-connect",
    			"request": "launch",
    			"name": "Launch blinky/build/blinky",
    			"config": "${workspaceFolder}/build/blinky",
    			"runToEntryPoint": "main"
    		}
    	]
    }

    click debug:

    Waiting for gdb server to start...[2026-05-05T10:27:25.024Z] SERVER CONSOLE DEBUG: 
    onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE"
    to see GDB interactions.
    "D:\\ncs\\openocd\\bin\\openocd" -c "gdb_port 50000" -c "tcl_port 50001"
    -c "telnet_port 50002" -s "d:/ncs/openocd/openocd/scripts/"
    -f "c:/Users/xiaom/.vscode/extensions/marus25.cortex-debug-1.12.1/support
    /openocd-helpers.tcl" -f ./dapNrf52.cfg
    xPack Open On-Chip Debugger 0.12.0+dev-02228-ge5888bda3-dirty (2025-10-04-22:44)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.org/doc/doxygen/bugs.html
    DEPRECATED! use 'gdb port', not 'gdb_port'
    DEPRECATED! use 'tcl port' not 'tcl_port'
    DEPRECATED! use 'telnet port', not 'telnet_port'
    CDLiveWatchSetup
    Info : CMSIS-DAP: SWD supported
    Info : CMSIS-DAP: Atomic commands supported
    Info : CMSIS-DAP: Test domain timer supported
    Info : CMSIS-DAP: FW Version = 1.2.0
    Info : CMSIS-DAP: Interface Initialised (SWD)
    Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
    Info : CMSIS-DAP: Interface ready
    Info : clock speed 1000 kHz
    Info : SWD DPIDR 0x2ba01477
    Info : [nrf52.cpu] Cortex-M4 r0p1 processor detected
    Info : [nrf52.cpu] target has 6 breakpoints, 4 watchpoints
    Info : [nrf52.cpu] Examination succeed
    Info : [nrf52.cpu] starting gdb server on 3333
    Info : Listening on port 3333 for gdb connections
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    [2026-05-05T10:27:27.140Z] SERVER CONSOLE DEBUG: GDBServerConsole: onBackendConnect: gdb-server program client error Error: read ECONNRESET
    [2026-05-05T10:27:27.166Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
    GDB server session ended. This terminal will be reused, waiting for next session to start...

    There are strange problems:

    1) where defined "D:\\ncs\\openocd\\bin\\openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "d:/ncs/openocd/openocd/scripts/" -f "c:/Users/xiaom/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" ? 

    2)it defined the ports to 5000x according to paramters above ,and I set it to other in dapNrf52.cfg:

    adapter driver cmsis-dap
    transport select swd
    # set WORKAREASIZE 0
    source [find target/nordic/nrf52.cfg]
    gdb port 3333
    telnet port 4444
    tcl port 6666
    init           
    # nrf52_recover 
     

    and it set as I defined :

    Info : Listening on port 3333 for gdb connections
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections

    It looks like the log was produced by openOCD / GDB server.

    The problem is : GBD client can't connect the server?

    I know we can set path in cortex-debug,will try later.

    I should provide the gdb port to gdb client if I set it in server side,how to set that? 

  • update:

    changed :

    "gdbPath": "D:\\ncs\\arm-gnu-toolchain-15\\bin\\
    to
    "gdbPath": "D:\\ncs\\arm-gnu-toolchain-15\\bin\\arm-none-eabi-gdb"
    now,output:
    Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
    "configuration": {
        "cwd": "D:\\ncs\\blinky",
        "executable": "D:/ncs/blinky/build/blinky/zephyr/zephyr.elf",
        "name": "Debug with OpenOCD",
        "request": "launch",
        "type": "cortex-debug",
        "servertype": "openocd",
        "configFiles": [
            "./dapNrf52.cfg"
        ],
        "searchDir": [
            "d:/ncs/openocd/openocd/scripts/"
        ],
        "gdbPath": "D:\\ncs\\arm-gnu-toolchain-15\\bin\\arm-none-eabi-gdb",
        "serverArgs": [
            "-s",
            "d:/ncs/openocd/openocd/scripts/",
            "-c",
            "gdb port 3333",
            "-c",
            "telnet port 4444",
            "-c",
            "tcl port 6666",
            "-c",
            "adapter speed 4000",
            "-c",
            "init"
        ],
        "runToEntryPoint": "main",
        "showDevDebugOutput": "both",
        "__configurationTarget": 6,
        "gdbServerConsolePort": 55878,
        "pvtAvoidPorts": [],
        "chainedConfigurations": {
            "enabled": false
        },
        "debuggerArgs": [],
        "swoConfig": {
            "enabled": false,
            "decoders": [],
            "cpuFrequency": 0,
            "swoFrequency": 0,
            "source": "probe"
        },
        "rttConfig": {
            "enabled": false,
            "decoders": []
        },
        "graphConfig": [],
        "preLaunchCommands": [],
        "postLaunchCommands": [],
        "preAttachCommands": [],
        "postAttachCommands": [],
        "preRestartCommands": [],
        "postRestartCommands": [],
        "preResetCommands": [],
        "postResetCommands": [],
        "serverpath": "D:\\ncs\\openocd\\bin\\openocd",
        "toolchainPath": "D:\\ncs\\arm-gnu-toolchain-15\\bin",
        "toolchainPrefix": "arm-none-eabi",
        "extensionPath": "c:/Users/xiaom/.vscode/extensions/marus25.cortex-debug-1.12.1",
        "registerUseNaturalFormat": true,
        "variableUseNaturalFormat": true,
        "pvtVersion": "1.12.1",
        "__sessionId": "f948acc3-bf27-4634-83ff-ee812a8c150b",
        "pvtShowDevDebugOutput": "both"
    }
    Reading symbols from D:/ncs/arm-gnu-toolchain-15/bin/arm-none-eabi-objdump.exe --syms -C -h -w D:/ncs/blinky/build/blinky/zephyr/zephyr.elf
    Reading symbols from d:/ncs/arm-gnu-toolchain-15/bin/arm-none-eabi-nm.exe --defined-only -S -l -C -p D:/ncs/blinky/build/blinky/zephyr/zephyr.elf
    Launching GDB: "D:\\ncs\\arm-gnu-toolchain-15\\bin\\arm-none-eabi-gdb" -q --interpreter=mi2
    1-gdb-version
    Launching gdb-server: "D:\\ncs\\openocd\\bin\\openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "d:/ncs/openocd/openocd/scripts/" -f "c:/Users/xiaom/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" -f ./dapNrf52.cfg -s "d:/ncs/openocd/openocd/scripts/" -c "gdb port 3333" -c "telnet port 4444" -c "tcl port 6666" -c "adapter speed 4000" -c init
        Please check TERMINAL tab (gdb-server) for output from D:\ncs\openocd\bin\openocd
    Finished reading symbols from objdump: Time: 200 ms
    Finished reading symbols from nm: Time: 246 ms
    -> =thread-group-added,id="i1"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"thread-group-added","output":[["id","i1"]]}]}
    -> ~"GNU gdb (Arm GNU Toolchain 15.2.Rel1 (Build arm-15.86)) 16.3.90.20250906-git\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"GNU gdb (Arm GNU Toolchain 15.2.Rel1 (Build arm-15.86)) 16.3.90.20250906-git\n"}]}
    -> ~"Copyright (C) 2024 Free Software Foundation, Inc.\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"Copyright (C) 2024 Free Software Foundation, Inc.\n"}]}
    -> ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."}]}
    -> ~"\nType \""
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"\nType \""}]}
    -> ~"show copying\" and \"show warranty\" for details.\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"show copying\" and \"show warranty\" for details.\n"}]}
    -> ~"This GDB was configured as \"--host=x86_64-w64-mingw32 --target=arm-none-eabi\".\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"This GDB was configured as \"--host=x86_64-w64-mingw32 --target=arm-none-eabi\".\n"}]}
    -> ~"Type \"show configuration\" for configuration details.\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"Type \"show configuration\" for configuration details.\n"}]}
    -> ~"For bug reporting instructions, please see:\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"For bug reporting instructions, please see:\n"}]}
    -> ~"<https://gitlab.arm.com/tooling/gnu-devtools-for-arm/-/issues/>.\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"<https://gitlab.arm.com/tooling/gnu-devtools-for-arm/-/issues/>.\n"}]}
    -> ~"Find the GDB manual and other documentation resources online at:\n    <"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"Find the GDB manual and other documentation resources online at:\n    <"}]}
    -> ~"http://www.gnu.org/software/gdb/documentation/>.\n\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"http://www.gnu.org/software/gdb/documentation/>.\n\n"}]}
    -> ~"For help, type \"help\".\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"For help, type \"help\".\n"}]}
    -> ~"Type \"apropos word\" to search for commands related to \"word\".\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"Type \"apropos word\" to search for commands related to \"word\".\n"}]}
    -> 1^done
    GDB -> App: {"output":"","token":1,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    2-gdb-set mi-async on
    -> 2^done
    GDB -> App: {"output":"","token":2,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    3-interpreter-exec console "set print demangle on"
    -> 3^done
    GDB -> App: {"output":"","token":3,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    4-interpreter-exec console "set print asm-demangle on"
    -> =cmd-param-changed,param="print asm-demangle",value="on"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"cmd-param-changed","output":[["param","print asm-demangle"],["value","on"]]}]}
    -> 4^done
    GDB -> App: {"output":"","token":4,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    5-enable-pretty-printing
    -> 5^done
    GDB -> App: {"output":"","token":5,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    6-interpreter-exec console "source c:/Users/xiaom/.vscode/extensions/marus25.cortex-debug-1.12.1/support/gdbsupport.init"
    -> 6^done
    GDB -> App: {"output":"","token":6,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    7-interpreter-exec console "source c:/Users/xiaom/.vscode/extensions/marus25.cortex-debug-1.12.1/support/gdb-swo.init"
    -> =cmd-param-changed,param="language",value="c"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"cmd-param-changed","output":[["param","language"],["value","c"]]}]}
    -> =cmd-param-changed,param="language",value="auto"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":false,"type":"notify","asyncClass":"cmd-param-changed","output":[["param","language"],["value","auto"]]}]}
    -> 7^done
    GDB -> App: {"output":"","token":7,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    8-interpreter-exec console "set output-radix 0xa"
    -> ~"Output radix now set to decimal 10, hex a, octal 12.\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"Output radix now set to decimal 10, hex a, octal 12.\n"}]}
    Output radix now set to decimal 10, hex a, octal 12.
    -> 8^done
    GDB -> App: {"output":"","token":8,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    9-interpreter-exec console "set input-radix 0xa"
    -> ~"Input radix now set to decimal 10, hex a, octal 12.\n"
    GDB -> App: {"output":"","outOfBandRecord":[{"isStream":true,"type":"console","content":"Input radix now set to decimal 10, hex a, octal 12.\n"}]}
    Input radix now set to decimal 10, hex a, octal 12.
    -> 9^done
    GDB -> App: {"output":"","token":9,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    10-file-exec-and-symbols "D:/ncs/blinky/build/blinky/zephyr/zephyr.elf"
    -> 10^done
    GDB -> App: {"output":"","token":10,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    11-target-select extended-remote localhost:50000
    -> 11^error,msg="could not connect (error 138): The system tried to join a drive to a directory on a joined drive."
    GDB -> App: {"output":"","token":11,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","could not connect (error 138): The system tried to join a drive to a directory on a joined drive."]]}}
    12-interpreter-exec console "monitor reset halt"
    Failed to launch GDB: could not connect (error 138): The system tried to join a drive to a directory on a joined drive. (from target-select extended-remote localhost:50000)
    GDB client has run,but,failed to connect the GDB server:
    11-target-select extended-remote localhost:50000
    -> 11^error,msg="could not connect (error 138): The system tried to join a drive to a directory on a joined drive."
    GDB -> App: {"output":"","token":11,"outOfBandRecord":[],"resultRecords":{"resultClass":"error","results":[["msg","could not connect (error 138): The system tried to join a drive to a directory on a joined drive."]]}}
    12-interpreter-exec console "monitor reset halt"
    Failed to launch GDB: could not connect (error 138): The system tried to join a drive to a directory on a joined drive. (from target-select extended-remote localhost:50000)
    GDB client try to connet " localhost:50000".
    but,GDB server listen on ports I set:
    Info : Listening on port 3333 for gdb connections
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    I have searched the website, this bug has been reported long long ago, and the author has said it will be solved in very earlier cortex-debug version.And most interesting thing is : he did not hard code the port numbers, then where it comes from?
    Big step: enter debug after giving up changing port number.
     
  • As reference for beginner,this is what I have done:

    1)install arm-gnu-toolchain : get arm-none-eabi-gdb.exe;

    2)install vs code;

    3)install nrf connect extensions in VS code;

    4)install cortex-debug extension in VS code;

    4.5)install openOCD;(update)

      Add path to PATH(windows) or set in scripts.

    5)burn chip with task:

    create task:

    {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "tasks": [
         {
    		"label": "recover nrf52 chips",
    		"group": "none",
    		"type": "shell",
            "command": "openocd",
            "args": [
                "-s", "d:/ncs/openocd/openocd/scripts/",
                "-f", "interface/cmsis-dap.cfg",    // 适配器驱动配置
                "-c", "transport select swd",       // 传输协议选择
                "-f", "target/nordic/nrf52.cfg",    // 目标芯片配置
                "-c", "init",
                "-c", "nrf52_recover" ,
                "-c", "reset",
                "-c", "exit 0"
            ]
        },
        {
    		"label": "flash merged firmware",
    		"group": "none",
    		"type": "shell",
            "command": "openocd",
            "args": [
                "-s", "d:/ncs/openocd/openocd/scripts/",
                "-f", "interface/cmsis-dap.cfg",    // 适配器驱动配置
                "-c", "transport select swd",       // 传输协议选择
                "-f", "target/nordic/nrf52.cfg",    // 目标芯片配置
                "-c", "program build/merged.hex preverify verify reset exit 0"
            ]
        }
    ]
    }

    bind Actions->flash with this task. 

    you can recover the chip with first task.

    6)create debug launch.json:

    {
    	"version": "0.2.0",
    	"configurations": [
    		{
    			"cwd": "${workspaceRoot}",
    			"executable": "./build/blinky/zephyr/zephyr.elf",
    			"name": "Debug with OpenOCD",
    			"request": "launch",
    			"type": "cortex-debug",
    			"servertype": "openocd",
    			"configFiles": ["./dapNrf52.cfg"],
    			"searchDir": ["d:/ncs/openocd/openocd/scripts/"],
    
    			"serverArgs": [
    				"-s",				"d:/ncs/openocd/openocd/scripts/",
    				//"-f","interface/cmsis-dap.cfg",
    				//"-c",				"set TRANSPORT swd",
    				//"-f","target/nordic/nrf52.cfg",
    				//"-c", "gdb port 3333",
    				"-c","telnet port 4444",
    				"-c","tcl port 6666",
    				"-c",				"adapter speed 4000",
    				"-c","init"
    				
    			],
    
    			"gdbPath": "D:\\ncs\\arm-gnu-toolchain-15\\bin\\arm-none-eabi-gdb",
    			//"gdbTarget": "localhost:3333",
    
    			"runToEntryPoint": "main",
    			"showDevDebugOutput": "both"
    		}
    	]
    }

    You can change your port number if it will not trigger "50000" error.

    7)bind Actions->debug to launch(Debug with OpenOCD,in this example);

    8)clik Actions->debug;

    The nrf connect extention will shift to debug GUI, and it maybe still try to use nrf tool and trigger error,

    Just ignore them,In debug GUI:

    You should select the right option in the drop down menu and then click the arrow button.

    Now you can see the log in debug console and TERMINAL(right bottom of the GUI,default).

    If anyone know how to deal with "5000" error, post here pls.

    Thanks.

Related