When it comes to Linux development, it is possible to choose several IDEs, workflows and programming languages for development. Aiming to simplify your development experience Toradex provides TorizonCore IDE integration with Visual Studio Code for Windows and Linux PCs, and Visual Studio for Windows PCs.
In this module, you will:
Note: support for other programming languages and more complex workflows will be presented to you at the end of the quickstart guide. If you have a Windows PC for development, you can also try the quickstart guide for Torizon with Windows selected as Development PC OS.
For this Getting Started Guide:
For this lesson:
You need to have the following applications installed on your development machine. Please, visit the developers' website to get instructions about how to obtain it.
You will also need Toradex hardware and computer on the same network.
Note: Carefully read this module's cover page clicking on "Module 2: First Steps with Torizon" on the left menu bar before starting this lesson.
Download the Torizon support package for Visual Studio Code and Python project's Github repository.
After the download, the file will be on Downloads folder, go to that directory and extract the archives to your home folder.
Open your terminal, and type the following commands:
$ cd Downloads $ unzip python-container-master.zip -d /home/$USER $ cd ~/python-container-master/
Create a new folder by copying the template directory:
$ cp -r template hello-world
Open Visual Studio Code. Click on File-> Open Folder menu.
Select the hello-world folder.
On the project explorer window, open the .vscode folder and click on the file settings.json.
toradexpython.targetDevice field with your board's IP or hostname.
ctrl+p and type
task deploydebugcontainer to start building.
The Build process of the release container image will start. It should complete successfully.
Warning: Please, be sure you have Arm emulation enabled on your PC. To enable it, please refer to the previous lessons.
Note: It is also recommended to configure your SSH Key to avoid the necessity of password every time, check more about it on the Passwordless SSH Configuration.
Create a new file hello.py on VS Code:
val = 1 print("Hello world") val = val + 1 print(val)
Put some breakpoints on the hello.py :
Press F5 to debug the hello.py script on the board. This will deploy the hello.py script from your developer computer to the board and it will stop the execution on the breakpoints set on the previous step:
Warning: Please note: By pressing a key on the terminal, the session will be closed. However, you still need the terminal for debugging. Hence, do not close the terminal while you are executing the debug session.
You can view variable values and use the debug tools of VS Code normally. You can see too the output generated by the script on the DEBUG CONSOLE tab: