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:
- Plug in your device to the serial terminal or RTT using an USB cable.
- Open the Panel View by pressing Ctrl-J.
- Click on the Terminal tab.
Expand the Launch Profile... dropdown list (the arrow next to the plus sign icon) located in the Panel Toolbar area.
Click on the nRF Serial Terminal option.
- 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.
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:
- In the Welcome View, click on Create a new application button. This opens the New Application page.
- Click the Browse button next to the Application template field. This opens the Sample Browser window.
- Search for the sample you have built and flashed.
- 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.
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:
- Make sure that your device is connected to your computer with an USB cable.
- Right-click the build configuration in the Applications View. A drop-down menu appears.
- Click Edit Build Configuration.
- On the Edit Build Configuration screen, check Enable debug options.
- 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.