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
  • Hi,

    We have fixed a few issues in cortex-debug extension. Please update to cortex-debug 0.4.6. Our investigation concluded that the issue you encounter is not related to the extension itself but an issue with JLink handling breakpoint on multiple symbols. This is solved in upstream Zephyr and most likely be resolved in on the next release of NCS.

    Kind regards,

    Wojtek

    VSC Team

Reply
  • Hi,

    We have fixed a few issues in cortex-debug extension. Please update to cortex-debug 0.4.6. Our investigation concluded that the issue you encounter is not related to the extension itself but an issue with JLink handling breakpoint on multiple symbols. This is solved in upstream Zephyr and most likely be resolved in on the next release of NCS.

    Kind regards,

    Wojtek

    VSC Team

Children
No Data
Related