I had many very similar issues. I’m using Windows 10 and had to addresses the forward vs backward path slashes issue between windows and linux. You can Google this topic to learn more. Below is exactly what I have in my launch.json to successfully debug blinky running the nRF9160 connected to the nRF5340-PDK with a Tag Connect (TC2030-CTX-NL) cable. Also, I followed Jared’s Debugging Visual Code from the https://docs.jaredwolff.com/nrf9160-programming-and-debugging.html#requirements-for-external-programming instructions.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}\\build\\zephyr\\zephyr.elf",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink",
"device": "nrf9160_xxAA",
"interface": "swd",
"armToolchainPath": "C:\\Program Files (x86)\\GNU Tools Arm Embedded\\9 2019-q4-major\\bin"
}
]
}
I hope this helps. I didn’t include the {} because when I copied this from my launch.json in VSC to this community website the second slash along the path is deleted. I presume this community site is running on a linux box. 🙂