Skip to content

How to flash, test, and debug

To test and debug an application, you must first connect your device to the terminal and flash it with the build configuration you have created. Read the following sections for detailed steps.

How to connect to the terminal

Complete the following steps to connect your device:

  1. Plug in your device to the serial terminal or RTT using an USB cable.
  2. Open the Panel View by pressing Ctrl-J.
  3. Click on the Terminal tab.
  4. Expand the Launch Profile... dropdown list (the arrow next to the plus sign icon) located in the Panel Toolbar area.

    RTT and serial terminal options

  5. Click on the nRF Serial Terminal option.

  6. Select the serial port from the Command Palette list.

The connection is started with the default configuration value presets.

See the Panel Views page for more information and other ways to connect to the terminal.

How to flash an application

To flash the application you have built, click the Flash button in the Actions View after connecting the device to the terminal.

Flash button

How to test an application

If you have built a sample or application included with the nRF Connect SDK without modifying it, you can test it by following the steps in the Testing section of its nRF Connect SDK documentation page. If you have made changes to your application, the steps may not be accurate for your use case, but you can still use them for reference.

To access the testing steps, open the nRF Connect SDK documentation page for the chosen application or sample:

  1. In the Welcome View, click on Create a new application button.
    This opens the New Application page.
  2. Click the Browse button next to the Application template field.
    This opens the Sample Browser window.
  3. Search for the sample you have built and flashed.
  4. Click the Open in browser button to visit its documentation page.

Follow the steps listed in the Testing section on the opened page.

How to debug an application

Complete the steps listed here to debug an nRF Connect SDK application or sample in Visual Studio Code.

Note

Ubuntu users with nRF Connect SDK v1.7.0 need to install the libcurses5 package for debugging to work properly. Run the following command:

sudo apt install libncurses5

How to enable debugging

Complete the following steps to enable debugging, if you have not already done so when setting up a build configuration:

  1. Make sure that your device is connected to your computer with an USB cable.
  2. Right-click the build configuration in the Applications View.
    A drop-down menu appears.
  3. Click Edit Build Configuration.
  4. On the Edit Build Configuration screen, check Enable debug options.
  5. Click Build Configuration.
    The build configuration is rebuilt with the full set of debug options enabled and the device is reflashed automatically.

How to start debugging

To start debugging, click on the Debug button in the Actions View.
The debugging toolbar appears at the top of the screen to let you control the debugging process.

For a more detailed explanation of the debugger that the extension uses, see the Debugging an application page. See also the the VS Code's debugging documentation for general information about how debugging in VS Code works.