Debugging overview - nRF Connect for VS Code
Skip to content

Debugging overview

The nRF Connect for VS Code extension provides a custom nrf-connect debug type to help troubleshoot problems. The debug type is integrated with the Visual Studio Code debugger and is meant for the nRF Connect SDK applications. It is based on Microsoft's debug adaptor and it allows you to analyze the thread, memory, and peripherals of your application.

Note

The features listed on this page require manually enabling debugging options. If you start debugging without enabling these options, the debugger will start without the features provided by the nrf-connect debug type.

The debug type comes with the following features:

  • Dedicated nRF Debug panel in the Panel View with sections dedicated to thread and memory analysis (Thread Viewer and Memory Explorer, respectively).
  • Dedicated Peripherals View in the Debug Sidebar.
  • Dedicated settings, such as nrf-connect.debugging.justMyCode.
  • Customizable launch and debug actions (see the dedicated guide for more information).
  • Integration with applications based on the nRF Connect SDK.

Thread Viewer

The Thread Viewer shows information about specific threads in your application, when applicable.

nRF Debug Thread Viewer

When debugging starts, the debugger pulls the threads out of the kernel and creates an entry in the Viewer for each thread it can find. The threads are listed in the order that they were started. Their state uses Zephyr's thread states and is only updated when the debugger is stopped. While the device is running, the View is frozen. Any state in the table is stale until execution is stopped again.

See the Panel Views page for more information about the UI of the Thread Viewer and the How to work with the Thread Viewer page for detailed information about the actions you can take in this part of the extension.

Memory Explorer

The Memory Explorer displays information about memory content.

nRF Debug's Memory Explorer

To display the memory content in your application with the symbol overlay, you must enable the debug symbol when adding the build. Failing to do so will just list the raw memory in the Memory Explorer.

See the Panel Views page for more information about the UI of the Memory Explorer and the How to work with the Memory Explorer page for detailed information about the actions you can take in this part of the extension, including how to create a custom memory region, which functions as a shortcut view of the configured memory address.

Peripherals View

When debugging starts, the debugger shows a memory map of peripherals from your device's SVD file and displays the values of their registers and fields. You can use this information to monitor and troubleshoot your hardware behavior.

The Peripherals View appears in the Debug Sidebar when debugging starts.

Peripherals View