Install and Configure Visual Studio Code
To build Xrt applications using Visual Studio on Windows, complete the following steps:
-
Install Visual Studio Code, if not already installed.
-
Install Build Tools.
-
Install the following extensions:
- Azure Sphere
- CMake Extensions
-
Install ncat (part of Nmap) (optional)
-
Navigate to the Azure Sphere example in the VS Code explorer.
Open .vscode/settings.json
- Ensure the value of the "DEVICE" configuration is set to the required device service, for example,
bacnet
orethernet-ip
. - Ensure the value of the "BOARD" configuration is set to the required board type.
The options are
mt3620-dk
,mt3620-g100
,mt3620-sk
ormt3620-sr620
.
- Ensure the value of the "DEVICE" configuration is set to the required device service, for example,
-
Configure the Application Manifest.
Open the app_manifest.json in the directory matching the board type, for example, mt3620-dk/app_manifest.json
- Follow the instructions for the BACnet, EtherNet/IP, or Modbus example to configure the example application in the example Git repo. See Use the Example Code.
-
Attach your Azure Sphere development board to your PC with the USB cable.
-
Start a UDP listener (optional). This allow application logging output to be viewed as log messages are created.
-
Open a command window or PowerShell.
-
Issue the command: PC running ncat.
ncat -l 1999 --keep-open --udp --recv-only
-
-
Configure the digital twin. See Configuring Xrt Using a Device Twin.
-
Build the application.
- Select the VSCode CMake view in the Activity Bar (leftmost column).
- Click the "Build" button in the Status Bar (bottom of the window).
-
Deploy and Debug the application.
- Select the VSCode Run and Debug view in the Activity Bar (leftmost column).
- Press F5 to download the application to your Azure Sphere board, the application will then start under the control of the debugger built into VS Code.