Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified en/quickstart/figures/007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified en/quickstart/figures/008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/020.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/021.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/022.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/023.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/025.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/026.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/027.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/028.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/029.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/030.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/031.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/032.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added en/quickstart/figures/033.png
Binary file added en/quickstart/figures/034.png
Binary file added en/quickstart/figures/035.png
Binary file added en/quickstart/figures/036.png
Binary file added en/quickstart/figures/037.png
Binary file added en/quickstart/figures/038.png
Binary file added en/quickstart/figures/039.png
Binary file added en/quickstart/figures/040.png
80 changes: 19 additions & 61 deletions en/quickstart/openvela_ubuntu_quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,91 +136,49 @@ After installation, you can run `repo --version` to verify it.
> - The initial sync can be time-consuming, depending on your network connection and disk performance.
> - If the sync is interrupted due to network issues, you can run `repo sync` again to resume.

## Step 3: Build the Source Code
## Step 3: Compile Source Code

After downloading the source code, perform the following compilation steps in the openvela root directory.
After downloading the source code, execute the following compilation steps in the openvela root directory.

### 1. Set Environment Variables
### 1. (Optional) Custom Kernel Configuration

Run the following command to add the paths of the prebuilt toolchains to the environment variables for the current terminal session.
You can use the `menuconfig` command to open a graphical interface to adjust the NuttX kernel and component configurations.

```Bash
uname_s=$(uname -s | tr '[A-Z]' '[a-z]')
uname_m=$(uname -m)
export PATH=$PWD/prebuilts/build-tools/${uname_s}-${uname_m}/bin:$PATH
export PATH=$PWD/prebuilts/cmake/${uname_s}-${uname_m}/bin:$PATH
export PATH=$PWD/prebuilts/python/${uname_s}-${uname_m}/bin:$PATH
export PATH=$PWD/prebuilts/gcc/${uname_s}-${uname_m}/aarch64-none-elf/bin:$PATH
export PATH=$PWD/prebuilts/gcc/${uname_s}-${uname_m}/arm-none-eabi/bin:$PATH
export PYTHONPATH=$PWD/prebuilts/tools/python/dist-packages/cxxfilt
export PYTHONPATH=$PWD/prebuilts/tools/python/dist-packages/kconfiglib:$PYTHONPATH
export PYTHONPATH=$PWD/prebuilts/tools/python/dist-packages/pyelftools:$PYTHONPATH
./build.sh vendor/openvela/boards/vela/configs/goldfish-arm64-v8a-ap/ --cmake menuconfig
```

> **Note**: These environment variable settings are only valid for the current terminal session. If you open a new terminal, you must run this script again.

### 2. Configure the CMake Project (Out-of-Tree)

openvela uses an **Out-of-tree build** approach, which separates the build artifacts from the source code to keep the source directory clean.

Run the following `cmake` command to configure the project. This command will:

- Generate build system files in the `cmake_out/goldfish-arm64-v8a-ap` directory.
- Use Ninja as the build tool to accelerate compilation.
- Specify the configuration file for the target board.

```Bash
cmake \
-B cmake_out/goldfish-arm64-v8a-ap \
-S $PWD/nuttx \
-GNinja \
-DBOARD_CONFIG=../vendor/openvela/boards/vela/configs/goldfish-arm64-v8a-ap \
-DEXTRA_FLAGS="-Wno-cpp -Wno-deprecated-declarations"
```

![alt text](./figures/005.png)

### 3. (Optional) Customize Kernel Configuration

You can use the `menuconfig` command to open a graphical interface to adjust the configuration of the NuttX kernel and its components.

```Bash
cmake --build cmake_out/goldfish-arm64-v8a-ap -t menuconfig
```

> **Tips**
> **Operation Tricks**
>
> - Press `/` to search for configuration options.
> - Press the `Spacebar` to toggle the selection state (enable/disable/module).
> - After configuring, select **Save** to save and exit.
> - Press `/` to search for configuration items.
> - Press `Space` to toggle selection status (Enable/Disable/Modularize).
> - After configuration, select **Save** to save and exit.

![alt text](./figures/006.png)
<img src="./figures/006.png" alt="" width="75%">

### 4. Start the Build
### 2. Execute Compilation

Execute the following command to build the entire project.

```Bash
cmake --build cmake_out/goldfish-arm64-v8a-ap
./build.sh vendor/openvela/boards/vela/configs/goldfish-arm64-v8a-ap/ --cmake -j$(nproc)
```

Upon successful compilation, you will find `nuttx` and other build artifacts in the `cmake_out/goldfish-arm64-v8a-ap` directory.
Upon successful compilation, you will find build artifacts such as `nuttx` in the `cmake_out/vela_goldfish-arm64-v8a-ap` directory.

![alt text](./figures/007.png)
<img src="./figures/007.png" alt="" width="75%">

## Step 4: Run the Emulator
## Step 4: Run Emulator

In the openvela root directory, run the following script to start the `Vela Emulator` and load your build artifacts.
In the openvela root directory, execute the following script to start the `Vela Emulator` and load your build artifacts.

```Bash
./emulator.sh cmake_out/goldfish-arm64-v8a-ap
./emulator.sh cmake_out/vela_goldfish-arm64-v8a-ap/
```

After the emulator starts, you will see the `goldfish-armv8a-ap>` prompt, indicating that openvela is running successfully.

![alt text](./figures/008.png)
After the emulator starts, you will see the `goldfish-armv8a-ap>` prompt, indicating that openvela has run successfully.

![alt text](./figures/009.png)
<img src="./figures/008.png" alt="" width="75%">

## Next Steps

Expand Down
Binary file added en/quickstart/videos/mount.mp4
Binary file not shown.
Binary file added en/quickstart/videos/plugin.mp4
Binary file not shown.
222 changes: 222 additions & 0 deletions en/quickstart/vscode_plugin_usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
# openvela VS Code Plugin User Guide

[ English | [简体中文](./../../zh-cn/quickstart/vscode_plugin_usage.md) ]

This document guides developers through installing the openvela VS Code plugin in an Ubuntu environment and completing openvela project creation, compilation, debugging, and application development.

## I. Environment Preparation

Before starting, please ensure the development environment meets the following hardware and software requirements.

### 1. Hardware Configuration

- **Disk**: At least **40 GB** of available space (for storing source code and compilation artifacts).
- **Memory**: At least **16 GB** RAM.

### 2. Operating System

- **System Version**: Ubuntu 22.04 (supports arm64 or x86_64 architectures).

## II. Installing openvela Extensions

> **Note**: Debugging features depend on the C++ extension; therefore, it must be installed and running in VS Code.

Search for and install the following in the VS Code (version >= 1.99.0) Extension Marketplace:

- vela.vs-aiot-ide-vela

<img src="./figures//010.png" alt="" width="75%">

- vela.vela-preview

<img src="./figures/011.png" alt="" width="75%">

## III. Environment Configuration and Verification

After the plugin is installed, check the development environment and install the necessary build toolchains and dependency packages.

### 1. Check and Install Dependencies

Refer to the image below to perform an environment check in VS Code. If prompted that components are missing, please follow the wizard to install them.

<img src="./figures/012.png" alt="" width="75%">

### 2. Verify Environment Readiness

When all dependencies are successfully installed, the interface will display the following content, indicating that the environment is ready:

<img src="./figures/013.png" alt="" width="75%">

## IV. Creating an openvela Project

### 1. Initialize Project Directory

Create a new directory in the file system (e.g., `openvela`).

> **Warning**: Ensure that the **absolute path** of this directory **does not contain Chinese characters, spaces, or other special symbols**; otherwise, the Build System will report errors.

### 2. Get Source Code

1. In VS Code, refer to the steps in the image below to open the "Create Project" wizard.

<img src="./figures/014.png" alt="" width="75%">

2. Configure project parameters:

- Select Source: Choose the appropriate repository source based on network conditions.
- Select Branch: Select the appropriate branch.

- trunk (Main Stable Branch): A fully tested stable version; stable features from the `dev` branch are merged here. Recommended for most users seeking stability.
- dev (Development Branch): Collects the latest features and fixes, which may be unstable. Recommended for developers who wish to experience new features or contribute.

- Download Method: Select SSH or HTTPS.

**Note**: If choosing the SSH method, please ensure that the SSH Key has been configured on the corresponding code hosting platform (click the blue link in the interface to view detailed documentation).

3. Select the `openvela` project directory created in step 1, and click **Select** in the upper right corner, as shown below:

<img src="./figures/015.png" alt="" width="75%">

4. Wait for the project creation to complete. The download progress is shown below:

**Note**: The source code download process takes a long time; please prevent the computer from entering sleep mode.

<img src="./figures/016.png" alt="" width="75%">

### 3. Configure Build Parameters

1. Open the created `openvela` directory:

<img src="./figures/017.png" alt="" width="75%">

2. Click the openvela **Sailboat** icon on the left, then click the **Configure** button, as shown below:

<img src="./figures/018.png" alt="" width="75%">

3. Select the corresponding `defconfig` file and other optional parameters:

<img src="./figures/019.png" alt="" width="75%">

## V. Compile and Run

### 1. Compile Project

1. Click the **Build** button and wait for the build system to complete compilation:

<img src="./figures/020.png" alt="" width="75%">

2. The compilation completion effect is shown below:

<img src="./figures/021.png" alt="" width="75%">

### 2. Run Simulator

1. Click the **Run** button to start the simulator:

<img src="./figures/022.png" alt="" width="75%">

2. Enter `lvgldemo` in the simulator terminal to launch the openvela demo application:

<img src="./figures/023.png" alt="" width="75%">

<img src="./figures/024.png" alt="" width="75%">

## VI. Debug Application

1. Click the **Debug** button. The system will start the simulator and attach the debugging process:

<img src="./figures/025.png" alt="" width="75%">

2. Open the source code file `apps/system/ping/ping.c` and set a breakpoint at the `main` function:

<img src="./figures/026.png" alt="" width="75%">

3. Execute the `ping` command in the simulator terminal. The system will run the Ping application, automatically hit the breakpoint, and enter debug mode.

<img src="./figures/027.png" alt="" width="75%">

## VII. Develop Native Application

### 1. Create Application

1. Click **Create Native App** in the plugin interface:

<img src="./figures/028.png" alt="" width="75%">

2. Select an application template:

<img src="./figures/029.png" alt="" width="75%">

3. Enter the project name (e.g., `Whackmole1`):

<img src="./figures/030.png" alt="" width="75%">

### 2. Compile and Run New Application

1. Upon completion, VS Code will automatically locate the source code directory of the new application.

<img src="./figures/031.png" alt="" width="75%">

2. Re-execute **Build** -> **Run**.

3. Enter the application name (e.g., `Whackmole1`) in the simulator terminal to start the new application.

## VIII. Resource Management and Visual Preview

The openvela plugin provides powerful visual preview capabilities, supporting images, fonts, and binary resources, as well as simulator file system mounting.

<video src="./videos/plugin.mp4" controls="controls" width="100%"></video>

### 1. Mount Data Volume

When using the `openvela` repository for the first time, the system will automatically pop up a terminal to execute the mount command, mounting `vela_data.bin` to the local directory.

<video src="./videos/mount.mp4" controls="controls" width="100%"></video>

Developers can manually manage the mount state via the right-click menu:

- Mount openvela: Execute mount.

<img src="./figures/032.png" alt="" width="75%">

<img src="./figures/033.png" alt="" width="75%">

- Remount openvela: When files in the simulator change (for example, after executing `adb push`), perform this operation to refresh the file system.

<img src="./figures/034.png" alt="" width="75%">

- Unmount openvela: Disconnect the mount.

### 2. File Preview

Supports previewing standard images, `.bin`, `.ttf`, and other formats (supports both absolute and relative paths).

<img src="./figures/035.png" alt="" width="75%">

### 3. Hover Preview

**Code Resource Preview**: Hovering the mouse over a resource path string will display a thumbnail of the resource.

<img src="./figures/036.png" alt="" width="75%">

<img src="./figures/037.png" alt="" width="75%">

### 4. Variable Preview during Debugging

In debug mode, hovering the mouse over a variable allows retrieving the current value and previewing it.

> **Tip**: Hold the `Alt` key to toggle between "Debug Value Hover" and "Standard Resource Hover".

<img src="./figures/038.png" alt="" width="75%">

<img src="./figures/039.png" alt="" width="75%">

### 5. Configure Preview Base Directory

1. Click the VS Code **Settings** button (or use the shortcut `Ctrl+,`).

2. Find **Extensions** in the left menu and select **AIoT Image Preview**.

3. Set the `Base Dir` parameter to adapt to different environments (such as simulator version).

<img src="./figures/040.png" alt="" width="75%">
Binary file modified zh-cn/quickstart/figures/007.png
Binary file modified zh-cn/quickstart/figures/008.png
Binary file removed zh-cn/quickstart/figures/009.png
Diff not rendered.
Binary file added zh-cn/quickstart/figures/010.png
Binary file added zh-cn/quickstart/figures/011.png
Binary file added zh-cn/quickstart/figures/012.png
Binary file added zh-cn/quickstart/figures/013.png
Binary file added zh-cn/quickstart/figures/014.png
Binary file added zh-cn/quickstart/figures/015.png
Binary file added zh-cn/quickstart/figures/016.png
Binary file added zh-cn/quickstart/figures/017.png
Binary file added zh-cn/quickstart/figures/018.png
Binary file added zh-cn/quickstart/figures/019.png
Binary file added zh-cn/quickstart/figures/020.png
Binary file added zh-cn/quickstart/figures/021.png
Binary file added zh-cn/quickstart/figures/022.png
Binary file added zh-cn/quickstart/figures/023.png
Binary file added zh-cn/quickstart/figures/024.png
Binary file added zh-cn/quickstart/figures/025.png
Binary file added zh-cn/quickstart/figures/026.png
Binary file added zh-cn/quickstart/figures/027.png
Binary file added zh-cn/quickstart/figures/028.png
Binary file added zh-cn/quickstart/figures/029.png
Binary file added zh-cn/quickstart/figures/030.png
Binary file added zh-cn/quickstart/figures/031.png
Binary file added zh-cn/quickstart/figures/032.png
Binary file added zh-cn/quickstart/figures/033.png
Binary file added zh-cn/quickstart/figures/034.png
Binary file added zh-cn/quickstart/figures/035.png
Binary file added zh-cn/quickstart/figures/036.png
Binary file added zh-cn/quickstart/figures/037.png
Binary file added zh-cn/quickstart/figures/038.png
Binary file added zh-cn/quickstart/figures/039.png
Binary file added zh-cn/quickstart/figures/040.png
Loading
Loading