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 Ctrl+J.
Click on the nRF Terminal tab.
Click on the first plug icon to connect and Start Terminal With New Configuration.
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.
- 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
Complete the following steps to enable debugging, if you have not already done so when 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. The 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 debug options enabled and the device is reflashed automatically.
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.