Visual Studio Code: Setup¶
This wiki page describes how to install and setup the environment for building and editing Arm Linux programs using Visual Studio Code.
Machines:- Local Machine
Because we are setting up VSCode, your local machine can be any OS. VSCode will usually be setup to connect to an appropriate Linux machine for building the code. - Remote Dev Machine
If your local machine is a Windows machine, then you usually need a Linux PC to build and develop the app.
If your local machine is running Linux or is Windows and has WSL2 setup, then you can use your local machine for this. You would skip the Remote - SSH setup and replace it with whatever is appropriate. - Target
The target is assumed to be running with an IP address that is accessible from the Remote Dev Machine.
Setup¶
Local Machine - Windows or Linux:- Install vscode https://code.visualstudio.com/download
- Install extensions
- Remote Development (Microsoft)
- C/C++ Extension Pack (Microsoft)
- Native Debug (WebFreak)
- Optional
- GitLens (GitKraken)
- SVN (Chris Johnston)
- Vim (vscodevim)
- Doxygen Documentation Generator (Christoph Schlosser)
- Shellcheck (Timon Wong)
- Restart vscode
- Configure vscode
- Setup ssh remote host
- ctrl-shift-p -> Remote-SSH: Add New SSH Host...
<username>@<your_remote_dev_machine_name_or_ip>
- Click >< symbol in bottom left and select "Connect to host..."
- Select <your_remote_dev_machine_name_or_ip>
vscode should connect to your_remote_dev_machine_name_or_ip and let you edit code and run commands via the terminal as if you were natively on the machine
First time may take a minute or so to setup
- ctrl-shift-p -> Remote-SSH: Add New SSH Host...
- Install extensions on remote
ctrl-shift-p > Remote: Install Local Extensions in 'ssh-remote+your_remote_dev_machine_name_or_ip'...
- Setup ssh remote host
Note: This can be run from vscode terminal
- Install the latest processor sdk. This will install the cross compiler for the linux applications.
- Follow the steps described in https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/latest/exports/docs/devices/AM62X/linux/Overview/Download_and_Install_the_SDK.html# to install the Processor SDK.
- It is assumed that your target is named target_62x. See ssh_target_naming_and_port_forwarding for details on how to setup a target name.
- Using a target name means the target IP address is not directly used in the commands. Instead, the target name is used.
- Populate a directory with the source code for your project
- Open vscode using directory as workspace
code your_project_directory
- See vscode_tasks_and_launch for information on creating a tasks.json file for build tasks and a launch.json file for information on launching targets for debug connections.
- You will use ctrl-shift-b to run a build task
- Configure IntelliSense following the instructions in https://code.visualstudio.com/docs/cpp/configure-intellisense-crosscompilation.
{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", "/home/<your_user_name>/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/linux-devkit/sysroots/aarch64-linux/usr/include/**" ], "defines": [], "compilerPath": "/home/<your_user_name>/ti-processor-sdk-linux-am62xx-evm-08.06.00.42/linux-devkit/sysroots/aarch64-linux/usr/bin/aarch64-none-linux-gnu-g++", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "linux-gcc-arm" } ], "version": 4 }
Summary¶
At this point your VScode should be initialized and ready to be used to build and debug a project.
Go to top