This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Debugging from VSCode with Cortex DEBUG and NRF Connect for VSCode

Hi, Im trying to get the debugger working in VSCode using the new nrfConnect for VSCode, while following the Youtube series for nRF Connect in VSCode. Im using the following versions:

nRF52840DK
nRF-Connect-2021.8.579.vsix
nRF-Terminal-2021.8.13.vsix
kconfig-lang-2021.8.3.vsix
devicetree-2021.8.2.vsix

In addition, Ive downloaded nRF Connect V3.7 and nRF Connect SDK V1.6.1.

I added the following lines to path, which got me a little further:


Now I get the following errors in the VSCode Debug Console:

Please check OUTPUT tab (Adapter Output) for output from JLinkGDBServerCL.exe
Launching server: "JLinkGDBServerCL.exe" "-singlerun" "-if" "swd" "-port" "50000" "-swoport" "50001" "-telnetport" "50002" "-device" "nRF52840_xxAA" "-select" "usb=683067661"
Launching GDB: "e:\Programs\NordicSemiconductor\ncs\v1.6.1\toolchain\opt\bin\arm-none-eabi-gdb.exe" "-q" "--interpreter=mi2"
undefinede:\Programs\NordicSemiconductor\ncs\v1.6.1\toolchain\opt\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
Reading symbols from e:\Revolve\Software\nRF_Example\BlinkLed_To_BareMetal\build\zephyr\zephyr.hex...
(No debugging symbols found in e:\Revolve\Software\nRF_Example\BlinkLed_To_BareMetal\build\zephyr\zephyr.hex)
0x00000452 in ?? ()
Program stopped, probably due to a reset and/or halt issued by debugger
add symbol table from file "e:/Revolve/Software/nRF_Example/BlinkLed_To_BareMetal/build/zephyr/zephyr.elf"
(y or n) [answered Y; input not from terminal]
Reading symbols from e:/Revolve/Software/nRF_Example/BlinkLed_To_BareMetal/build/zephyr/zephyr.elf...
2
Resetting target


The last line in the output is "Starting target CPU..."

My CMakeLists.txt looks like this, most of this is just adding stuff to see if it works:
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(gpio_testing)

add_definitions(-g -v -v -DDEBUG)

add_compile_options(
  "-Wall" "-Wpedantic" "-Wextra" "-fexceptions"
  "$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>"
)

set(CMAKE_BUILD_TYPE Debug)

target_sources(app PRIVATE src/main.c
                           src/gpio/gpio.c)



What are the points Im missing to get debugger to work in VSCode?

Parents
  • I just got my official nRF52840DK in and am seeing the same issue. I can successfully build and flash code to the device and verify it blinks at various speeds. However when using debug, I get the console output below as well as seeing "nRF Terminal Trying to Reconnect..." on the bottom status bar. If I play around with pausing it, sometimes I can get it to stop in cpu_idle.S(159).

    Reading symbols from [PATH]/myfirstapp/build/zephyr/zephyr.hex...
    (No debugging symbols found in [PATH]/myfirstapp/build/zephyr/zephyr.hex)
    0x00001a2a in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "[PATH]/myfirstapp/build/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from [PATH]/myfirstapp/build/zephyr/zephyr.elf...
    2
    Resetting target
Reply
  • I just got my official nRF52840DK in and am seeing the same issue. I can successfully build and flash code to the device and verify it blinks at various speeds. However when using debug, I get the console output below as well as seeing "nRF Terminal Trying to Reconnect..." on the bottom status bar. If I play around with pausing it, sometimes I can get it to stop in cpu_idle.S(159).

    Reading symbols from [PATH]/myfirstapp/build/zephyr/zephyr.hex...
    (No debugging symbols found in [PATH]/myfirstapp/build/zephyr/zephyr.hex)
    0x00001a2a in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "[PATH]/myfirstapp/build/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from [PATH]/myfirstapp/build/zephyr/zephyr.elf...
    2
    Resetting target
Children
Related