Create a Single-Container Project
Introduction
This article guides you on creating a single-container project using the Torizon IDE Extension 2. The extension provides templates to start from and automates the dependency installation process. By the end of this article, you will be ready to choose the correct template for your project and start your application development.
The instructions provided in this article works for both Linux and Windows environment. When required for a particular OS environment, specific additional instructions will be provided.
Prerequisites
- Having understood the basics of Torizon IDE Extension 2.
- Toradex Computer on Module (CoM) with TorizonCore installed.
- Having connected a TorizonCore target device.
Start a New Project from a Template
Create a new project: open a new VS Code window (
Ctrl + Shift + N
). Click theExplorer
icon (1) on the left menu bar. There will be two buttons for creating projects. ClickNew Torizon Project
(2).Select a template: you will see a new tab with a list of templates that can be used for the project creation. Click the image that closely matches your project requirements.
infoNote that there are Toradex-supported templates and community-supported templates. Toradex-supported templates are templates with development stacks commonly used by customers of the Torizon platform. These templates are maintained by the Toradex Torizon team and pass through a quality assurance process. The quality and maintenance of community templates are the sole responsibility of their contributors.
Input the project name, container name and creation path. Then, click
Create Project
:- Use just letters and numbers in your project name.
- The container name also accepts the
-
symbol. - The
Creation path
is the system folder in which the project files will be stored.
This will trigger the creation project task with the user inputs. You can monitor its process by checking the terminal at the bottom of the VS Code interface. Then, the VS Code window will reload using the newly created project as the default workspace.
Check for dependencies on your system: during the first load of a new project, the notification
Do you want to check for dependencies on your system?
will appear. ClickYes
. Then, the extension will check the needed packages to build the project. If there are missing packages, it will install them.infoDuring the first load of a new project, some extra tasks are triggered:
run-torizon-binfmt
: it runs the torizon/binfmt Docker image to register foreign architecture interpreters, which is necessary to build containers for arm architecture.run-docker-registry
: it runs a local Docker registry to enable image exchange between the development PC and the target device.run-share-wsl-ports
: This task is specific for Windows users (that need to use WSL 2). By default, services created on a WSL 2 distro are not visible to the external network. This task runs a PowerShell script on the Windows side as administrator, which binds the necessary ports between WSL 2 and Windows to be accessible from the target device.check-deps
: This task checks the necessary packages (such as SDK, for example) to build the project. If there are missing packages, it tries to install them.For Windows (WSL 2) users only: The
run-share-wsl-ports
task runs a PowerShell script as administrator on the Windows side. This requires user confirmation, so aUser Account Control
window will appear.Click
Yes
. After the confirmation, a new empty terminal will pop up. Do not close it. The terminal will run the script and then will be closed automatically.
Install dependencies: if any missing dependencies are detected, the
check-deps
task will try to install them. Confirm the installation and yoursudo
password will be requested.Proceed with your project development: now you can remotely debug your project.