diff --git a/en/quickstart/figures/007.png b/en/quickstart/figures/007.png index a3d69187..ecea008b 100644 Binary files a/en/quickstart/figures/007.png and b/en/quickstart/figures/007.png differ diff --git a/en/quickstart/figures/008.png b/en/quickstart/figures/008.png index 14779897..7fdf2a81 100644 Binary files a/en/quickstart/figures/008.png and b/en/quickstart/figures/008.png differ diff --git a/en/quickstart/figures/010.png b/en/quickstart/figures/010.png new file mode 100644 index 00000000..d9a321d5 Binary files /dev/null and b/en/quickstart/figures/010.png differ diff --git a/en/quickstart/figures/011.png b/en/quickstart/figures/011.png new file mode 100644 index 00000000..767adb90 Binary files /dev/null and b/en/quickstart/figures/011.png differ diff --git a/en/quickstart/figures/012.png b/en/quickstart/figures/012.png new file mode 100644 index 00000000..1e44061e Binary files /dev/null and b/en/quickstart/figures/012.png differ diff --git a/en/quickstart/figures/013.png b/en/quickstart/figures/013.png new file mode 100644 index 00000000..d089c87f Binary files /dev/null and b/en/quickstart/figures/013.png differ diff --git a/en/quickstart/figures/014.png b/en/quickstart/figures/014.png new file mode 100644 index 00000000..234666cc Binary files /dev/null and b/en/quickstart/figures/014.png differ diff --git a/en/quickstart/figures/015.png b/en/quickstart/figures/015.png new file mode 100644 index 00000000..d1b17f60 Binary files /dev/null and b/en/quickstart/figures/015.png differ diff --git a/en/quickstart/figures/016.png b/en/quickstart/figures/016.png new file mode 100644 index 00000000..e0a22530 Binary files /dev/null and b/en/quickstart/figures/016.png differ diff --git a/en/quickstart/figures/017.png b/en/quickstart/figures/017.png new file mode 100644 index 00000000..d69ab460 Binary files /dev/null and b/en/quickstart/figures/017.png differ diff --git a/en/quickstart/figures/018.png b/en/quickstart/figures/018.png new file mode 100644 index 00000000..19bfecbd Binary files /dev/null and b/en/quickstart/figures/018.png differ diff --git a/en/quickstart/figures/019.png b/en/quickstart/figures/019.png new file mode 100644 index 00000000..ad605f49 Binary files /dev/null and b/en/quickstart/figures/019.png differ diff --git a/en/quickstart/figures/020.png b/en/quickstart/figures/020.png new file mode 100644 index 00000000..c65be9ff Binary files /dev/null and b/en/quickstart/figures/020.png differ diff --git a/en/quickstart/figures/021.png b/en/quickstart/figures/021.png new file mode 100644 index 00000000..4a3da60f Binary files /dev/null and b/en/quickstart/figures/021.png differ diff --git a/en/quickstart/figures/022.png b/en/quickstart/figures/022.png new file mode 100644 index 00000000..2a456208 Binary files /dev/null and b/en/quickstart/figures/022.png differ diff --git a/en/quickstart/figures/023.png b/en/quickstart/figures/023.png new file mode 100644 index 00000000..60858f8c Binary files /dev/null and b/en/quickstart/figures/023.png differ diff --git a/en/quickstart/figures/024.png b/en/quickstart/figures/024.png new file mode 100644 index 00000000..6b0652c0 Binary files /dev/null and b/en/quickstart/figures/024.png differ diff --git a/en/quickstart/figures/025.png b/en/quickstart/figures/025.png new file mode 100644 index 00000000..885cee3a Binary files /dev/null and b/en/quickstart/figures/025.png differ diff --git a/en/quickstart/figures/026.png b/en/quickstart/figures/026.png new file mode 100644 index 00000000..ef498dd9 Binary files /dev/null and b/en/quickstart/figures/026.png differ diff --git a/en/quickstart/figures/027.png b/en/quickstart/figures/027.png new file mode 100644 index 00000000..8bc5d9c9 Binary files /dev/null and b/en/quickstart/figures/027.png differ diff --git a/en/quickstart/figures/028.png b/en/quickstart/figures/028.png new file mode 100644 index 00000000..aa7e3825 Binary files /dev/null and b/en/quickstart/figures/028.png differ diff --git a/en/quickstart/figures/029.png b/en/quickstart/figures/029.png new file mode 100644 index 00000000..a5fa73bc Binary files /dev/null and b/en/quickstart/figures/029.png differ diff --git a/en/quickstart/figures/030.png b/en/quickstart/figures/030.png new file mode 100644 index 00000000..4da54758 Binary files /dev/null and b/en/quickstart/figures/030.png differ diff --git a/en/quickstart/figures/031.png b/en/quickstart/figures/031.png new file mode 100644 index 00000000..d9fe30da Binary files /dev/null and b/en/quickstart/figures/031.png differ diff --git a/en/quickstart/figures/032.png b/en/quickstart/figures/032.png new file mode 100644 index 00000000..d1645450 Binary files /dev/null and b/en/quickstart/figures/032.png differ diff --git a/en/quickstart/figures/033.png b/en/quickstart/figures/033.png new file mode 100644 index 00000000..f3214fb5 Binary files /dev/null and b/en/quickstart/figures/033.png differ diff --git a/en/quickstart/figures/034.png b/en/quickstart/figures/034.png new file mode 100644 index 00000000..e101d28a Binary files /dev/null and b/en/quickstart/figures/034.png differ diff --git a/en/quickstart/figures/035.png b/en/quickstart/figures/035.png new file mode 100644 index 00000000..e36d2398 Binary files /dev/null and b/en/quickstart/figures/035.png differ diff --git a/en/quickstart/figures/036.png b/en/quickstart/figures/036.png new file mode 100644 index 00000000..3a81ab54 Binary files /dev/null and b/en/quickstart/figures/036.png differ diff --git a/en/quickstart/figures/037.png b/en/quickstart/figures/037.png new file mode 100644 index 00000000..492cc345 Binary files /dev/null and b/en/quickstart/figures/037.png differ diff --git a/en/quickstart/figures/038.png b/en/quickstart/figures/038.png new file mode 100644 index 00000000..c12e3f26 Binary files /dev/null and b/en/quickstart/figures/038.png differ diff --git a/en/quickstart/figures/039.png b/en/quickstart/figures/039.png new file mode 100644 index 00000000..f5f5d3f4 Binary files /dev/null and b/en/quickstart/figures/039.png differ diff --git a/en/quickstart/figures/040.png b/en/quickstart/figures/040.png new file mode 100644 index 00000000..6c0801c0 Binary files /dev/null and b/en/quickstart/figures/040.png differ diff --git a/en/quickstart/openvela_ubuntu_quick_start.md b/en/quickstart/openvela_ubuntu_quick_start.md index dc5bb839..28d09e62 100644 --- a/en/quickstart/openvela_ubuntu_quick_start.md +++ b/en/quickstart/openvela_ubuntu_quick_start.md @@ -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) + -### 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) + -## 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) + ## Next Steps diff --git a/en/quickstart/videos/mount.mp4 b/en/quickstart/videos/mount.mp4 new file mode 100644 index 00000000..88665535 Binary files /dev/null and b/en/quickstart/videos/mount.mp4 differ diff --git a/en/quickstart/videos/plugin.mp4 b/en/quickstart/videos/plugin.mp4 new file mode 100644 index 00000000..1b1caa08 Binary files /dev/null and b/en/quickstart/videos/plugin.mp4 differ diff --git a/en/quickstart/vscode_plugin_usage.md b/en/quickstart/vscode_plugin_usage.md new file mode 100644 index 00000000..a3535be0 --- /dev/null +++ b/en/quickstart/vscode_plugin_usage.md @@ -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 + + + +- vela.vela-preview + + + +## 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. + + + +### 2. Verify Environment Readiness + +When all dependencies are successfully installed, the interface will display the following content, indicating that the environment is ready: + + + +## 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. + + + +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: + + + +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. + + + +### 3. Configure Build Parameters + +1. Open the created `openvela` directory: + + + +2. Click the openvela **Sailboat** icon on the left, then click the **Configure** button, as shown below: + + + +3. Select the corresponding `defconfig` file and other optional parameters: + + + +## V. Compile and Run + +### 1. Compile Project + +1. Click the **Build** button and wait for the build system to complete compilation: + + + +2. The compilation completion effect is shown below: + + + +### 2. Run Simulator + +1. Click the **Run** button to start the simulator: + + + +2. Enter `lvgldemo` in the simulator terminal to launch the openvela demo application: + + + + + +## VI. Debug Application + +1. Click the **Debug** button. The system will start the simulator and attach the debugging process: + + + +2. Open the source code file `apps/system/ping/ping.c` and set a breakpoint at the `main` function: + + + +3. Execute the `ping` command in the simulator terminal. The system will run the Ping application, automatically hit the breakpoint, and enter debug mode. + + + +## VII. Develop Native Application + +### 1. Create Application + +1. Click **Create Native App** in the plugin interface: + + + +2. Select an application template: + + + +3. Enter the project name (e.g., `Whackmole1`): + + + +### 2. Compile and Run New Application + +1. Upon completion, VS Code will automatically locate the source code directory of the new application. + + + +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. + + + +### 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. + + + +Developers can manually manage the mount state via the right-click menu: + +- Mount openvela: Execute mount. + + + + + +- Remount openvela: When files in the simulator change (for example, after executing `adb push`), perform this operation to refresh the file system. + + + +- Unmount openvela: Disconnect the mount. + +### 2. File Preview + +Supports previewing standard images, `.bin`, `.ttf`, and other formats (supports both absolute and relative paths). + + + +### 3. Hover Preview + +**Code Resource Preview**: Hovering the mouse over a resource path string will display a thumbnail of the resource. + + + + + +### 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". + + + + + +### 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). + + diff --git a/zh-cn/quickstart/figures/007.png b/zh-cn/quickstart/figures/007.png index a3d69187..ecea008b 100644 Binary files a/zh-cn/quickstart/figures/007.png and b/zh-cn/quickstart/figures/007.png differ diff --git a/zh-cn/quickstart/figures/008.png b/zh-cn/quickstart/figures/008.png index 14779897..7fdf2a81 100644 Binary files a/zh-cn/quickstart/figures/008.png and b/zh-cn/quickstart/figures/008.png differ diff --git a/zh-cn/quickstart/figures/009.png b/zh-cn/quickstart/figures/009.png deleted file mode 100644 index 7d4dafa8..00000000 Binary files a/zh-cn/quickstart/figures/009.png and /dev/null differ diff --git a/zh-cn/quickstart/figures/010.png b/zh-cn/quickstart/figures/010.png new file mode 100644 index 00000000..d9a321d5 Binary files /dev/null and b/zh-cn/quickstart/figures/010.png differ diff --git a/zh-cn/quickstart/figures/011.png b/zh-cn/quickstart/figures/011.png new file mode 100644 index 00000000..767adb90 Binary files /dev/null and b/zh-cn/quickstart/figures/011.png differ diff --git a/zh-cn/quickstart/figures/012.png b/zh-cn/quickstart/figures/012.png new file mode 100644 index 00000000..1e44061e Binary files /dev/null and b/zh-cn/quickstart/figures/012.png differ diff --git a/zh-cn/quickstart/figures/013.png b/zh-cn/quickstart/figures/013.png new file mode 100644 index 00000000..d089c87f Binary files /dev/null and b/zh-cn/quickstart/figures/013.png differ diff --git a/zh-cn/quickstart/figures/014.png b/zh-cn/quickstart/figures/014.png new file mode 100644 index 00000000..234666cc Binary files /dev/null and b/zh-cn/quickstart/figures/014.png differ diff --git a/zh-cn/quickstart/figures/015.png b/zh-cn/quickstart/figures/015.png new file mode 100644 index 00000000..d1b17f60 Binary files /dev/null and b/zh-cn/quickstart/figures/015.png differ diff --git a/zh-cn/quickstart/figures/016.png b/zh-cn/quickstart/figures/016.png new file mode 100644 index 00000000..e0a22530 Binary files /dev/null and b/zh-cn/quickstart/figures/016.png differ diff --git a/zh-cn/quickstart/figures/017.png b/zh-cn/quickstart/figures/017.png new file mode 100644 index 00000000..d69ab460 Binary files /dev/null and b/zh-cn/quickstart/figures/017.png differ diff --git a/zh-cn/quickstart/figures/018.png b/zh-cn/quickstart/figures/018.png new file mode 100644 index 00000000..19bfecbd Binary files /dev/null and b/zh-cn/quickstart/figures/018.png differ diff --git a/zh-cn/quickstart/figures/019.png b/zh-cn/quickstart/figures/019.png new file mode 100644 index 00000000..ad605f49 Binary files /dev/null and b/zh-cn/quickstart/figures/019.png differ diff --git a/zh-cn/quickstart/figures/020.png b/zh-cn/quickstart/figures/020.png new file mode 100644 index 00000000..c65be9ff Binary files /dev/null and b/zh-cn/quickstart/figures/020.png differ diff --git a/zh-cn/quickstart/figures/021.png b/zh-cn/quickstart/figures/021.png new file mode 100644 index 00000000..4a3da60f Binary files /dev/null and b/zh-cn/quickstart/figures/021.png differ diff --git a/zh-cn/quickstart/figures/022.png b/zh-cn/quickstart/figures/022.png new file mode 100644 index 00000000..2a456208 Binary files /dev/null and b/zh-cn/quickstart/figures/022.png differ diff --git a/zh-cn/quickstart/figures/023.png b/zh-cn/quickstart/figures/023.png new file mode 100644 index 00000000..60858f8c Binary files /dev/null and b/zh-cn/quickstart/figures/023.png differ diff --git a/zh-cn/quickstart/figures/024.png b/zh-cn/quickstart/figures/024.png new file mode 100644 index 00000000..6b0652c0 Binary files /dev/null and b/zh-cn/quickstart/figures/024.png differ diff --git a/zh-cn/quickstart/figures/025.png b/zh-cn/quickstart/figures/025.png new file mode 100644 index 00000000..885cee3a Binary files /dev/null and b/zh-cn/quickstart/figures/025.png differ diff --git a/zh-cn/quickstart/figures/026.png b/zh-cn/quickstart/figures/026.png new file mode 100644 index 00000000..ef498dd9 Binary files /dev/null and b/zh-cn/quickstart/figures/026.png differ diff --git a/zh-cn/quickstart/figures/027.png b/zh-cn/quickstart/figures/027.png new file mode 100644 index 00000000..8bc5d9c9 Binary files /dev/null and b/zh-cn/quickstart/figures/027.png differ diff --git a/zh-cn/quickstart/figures/028.png b/zh-cn/quickstart/figures/028.png new file mode 100644 index 00000000..aa7e3825 Binary files /dev/null and b/zh-cn/quickstart/figures/028.png differ diff --git a/zh-cn/quickstart/figures/029.png b/zh-cn/quickstart/figures/029.png new file mode 100644 index 00000000..a5fa73bc Binary files /dev/null and b/zh-cn/quickstart/figures/029.png differ diff --git a/zh-cn/quickstart/figures/030.png b/zh-cn/quickstart/figures/030.png new file mode 100644 index 00000000..4da54758 Binary files /dev/null and b/zh-cn/quickstart/figures/030.png differ diff --git a/zh-cn/quickstart/figures/031.png b/zh-cn/quickstart/figures/031.png new file mode 100644 index 00000000..d9fe30da Binary files /dev/null and b/zh-cn/quickstart/figures/031.png differ diff --git a/zh-cn/quickstart/figures/032.png b/zh-cn/quickstart/figures/032.png new file mode 100644 index 00000000..d1645450 Binary files /dev/null and b/zh-cn/quickstart/figures/032.png differ diff --git a/zh-cn/quickstart/figures/033.png b/zh-cn/quickstart/figures/033.png new file mode 100644 index 00000000..f3214fb5 Binary files /dev/null and b/zh-cn/quickstart/figures/033.png differ diff --git a/zh-cn/quickstart/figures/034.png b/zh-cn/quickstart/figures/034.png new file mode 100644 index 00000000..e101d28a Binary files /dev/null and b/zh-cn/quickstart/figures/034.png differ diff --git a/zh-cn/quickstart/figures/035.png b/zh-cn/quickstart/figures/035.png new file mode 100644 index 00000000..e36d2398 Binary files /dev/null and b/zh-cn/quickstart/figures/035.png differ diff --git a/zh-cn/quickstart/figures/036.png b/zh-cn/quickstart/figures/036.png new file mode 100644 index 00000000..3a81ab54 Binary files /dev/null and b/zh-cn/quickstart/figures/036.png differ diff --git a/zh-cn/quickstart/figures/037.png b/zh-cn/quickstart/figures/037.png new file mode 100644 index 00000000..492cc345 Binary files /dev/null and b/zh-cn/quickstart/figures/037.png differ diff --git a/zh-cn/quickstart/figures/038.png b/zh-cn/quickstart/figures/038.png new file mode 100644 index 00000000..c12e3f26 Binary files /dev/null and b/zh-cn/quickstart/figures/038.png differ diff --git a/zh-cn/quickstart/figures/039.png b/zh-cn/quickstart/figures/039.png new file mode 100644 index 00000000..f5f5d3f4 Binary files /dev/null and b/zh-cn/quickstart/figures/039.png differ diff --git a/zh-cn/quickstart/figures/040.png b/zh-cn/quickstart/figures/040.png new file mode 100644 index 00000000..6c0801c0 Binary files /dev/null and b/zh-cn/quickstart/figures/040.png differ diff --git a/zh-cn/quickstart/openvela_ubuntu_quick_start.md b/zh-cn/quickstart/openvela_ubuntu_quick_start.md index 2a279bb2..4156fa05 100644 --- a/zh-cn/quickstart/openvela_ubuntu_quick_start.md +++ b/zh-cn/quickstart/openvela_ubuntu_quick_start.md @@ -140,52 +140,12 @@ sudo mv repo /usr/local/bin 完成源代码下载后,请在 openvela 根目录下执行以下编译步骤。 -### 1. 设置环境变量 - -执行以下命令,将预编译的工具链路径添加到当前终端会话的环境变量中。 - -```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 -``` - -> **注意**: 此环境变量配置仅在当前终端窗口有效。若新开终端,需重新执行此脚本。 - -### 2. 配置 CMake 项目 (Out-of-Tree) - -openvela 采用 **Out-of-tree build** 模式,该模式将编译产物与源代码分离,以保持源码目录的整洁。 - -运行以下 `cmake` 命令来配置项目。此命令将: - -- 在 `cmake_out/goldfish-arm64-v8a-ap` 目录下生成构建系统文件。 -- 使用 Ninja 作为构建工具以提升编译速度。 -- 指定目标板的配置文件。 - -```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. (可选)自定义内核配置 +### 1. (可选)自定义内核配置 您可以通过 `menuconfig` 命令打开图形化界面,以调整 NuttX 内核与组件的配置。 ```Bash -cmake --build cmake_out/goldfish-arm64-v8a-ap -t menuconfig +./build.sh vendor/openvela/boards/vela/configs/goldfish-arm64-v8a-ap/ --cmake menuconfig ``` > **操作技巧** @@ -194,33 +154,31 @@ cmake --build cmake_out/goldfish-arm64-v8a-ap -t menuconfig > - 按 `空格键` 可切换选中状态(启用/禁用/模块化)。 > - 配置完成后,选择 **Save** 保存并退出。 -![alt text](./figures/006.png) + -### 4. 执行编译 +### 2. 执行编译 执行以下命令,构建整个项目。 ```Bash -cmake --build cmake_out/goldfish-arm64-v8a-ap +./build.sh vendor/openvela/boards/vela/configs/goldfish-arm64-v8a-ap/ --cmake -j$(nproc) ``` -编译成功后,您将在 `cmake_out/goldfish-arm64-v8a-ap` 目录下找到 `nuttx` 等编译产物。 +编译成功后,您将在 `cmake_out/vela_goldfish-arm64-v8a-ap` 目录下找到 `nuttx` 等编译产物。 -![alt text](./figures/007.png) + ## 步骤四:运行模拟器 在 openvela 根目录下,执行以下脚本启动 `Vela Emulator` 并加载您的编译产物。 ```Bash -./emulator.sh cmake_out/goldfish-arm64-v8a-ap +./emulator.sh cmake_out/vela_goldfish-arm64-v8a-ap/ ``` 模拟器启动后,您将看到 `goldfish-armv8a-ap>` 提示符,表明 openvela 已成功运行。 -![alt text](./figures/008.png) - -![alt text](./figures/009.png) + ## 后续步骤 diff --git a/zh-cn/quickstart/videos/mount.mp4 b/zh-cn/quickstart/videos/mount.mp4 new file mode 100644 index 00000000..88665535 Binary files /dev/null and b/zh-cn/quickstart/videos/mount.mp4 differ diff --git a/zh-cn/quickstart/videos/plugin.mp4 b/zh-cn/quickstart/videos/plugin.mp4 new file mode 100644 index 00000000..1b1caa08 Binary files /dev/null and b/zh-cn/quickstart/videos/plugin.mp4 differ diff --git a/zh-cn/quickstart/vscode_plugin_usage.md b/zh-cn/quickstart/vscode_plugin_usage.md index a371dafc..19ca38be 100644 --- a/zh-cn/quickstart/vscode_plugin_usage.md +++ b/zh-cn/quickstart/vscode_plugin_usage.md @@ -1,3 +1,219 @@ # openvela VS Code 插件使用指南 +[ [English](../../en/quickstart/vscode_plugin_usage.md) | 简体中文 ] + 本文档指导开发者在 Ubuntu 环境下安装 openvela VS Code 插件,并完成 openvela 项目的创建、编译、调试及应用开发。 + +## 一、环境准备 + +在开始之前,请确保开发环境满足以下软硬件要求。 + +### 1、硬件配置 + +- **硬盘**:至少 **40 GB** 可用空间(用于存放源代码及编译产物)。 +- **内存**:至少 **16** **GB** RAM。 + +### 2、操作系统 + +- **系统版本**:Ubuntu 22.04 (支持 arm64 或 x86_64 架构)。 + +## 二、安装 openvela 扩展插件 + +> **注意**:调试功能依赖 C++ 插件,因此必须在 VS Code 中进行安装和运行。 + +在 VS Code(版本 >= 1.99.0)扩展市场搜索并安装 。 + +- vela.vs-aiot-ide-vela + + + +- vela.vela-preview + + + +## 三、配置与验证环境 + +插件安装完成后,需检查开发环境并安装必要的构建工具链和依赖包。 + +### 1、检查并安装依赖 + +参考下图,在 VS Code 中执行环境检查。如提示缺少组件,请按照向导提示进行安装。 + + + +### 2、验证环境就绪 + +当所有依赖安装成功后,界面将显示如下内容,表明环境准备就绪: + + + +## 四、创建 openvela 项目 + +### 1、初始化项目目录 + +在文件系统中创建一个新目录(例如 `openvela`)。 + +> **警告**:请确保该目录的**绝对路径**中**不包含中文字符或空格等特殊符号**,否则会导致编译系统(Build System)报错。 + +### 2、获取源代码 + +1. 在 VS Code 中,参考下图步骤打开“创建项目”向导。 + + + +2. 配置项目参数: + + - 选择源:根据网络情况选择合适的仓库源。 + - 选择分支:选择合适分支分支。 + + - trunk (主干稳定分支):经全面测试的稳定版本,`dev` 分支的稳定功能会合并于此。推荐大多数追求稳定性的用户使用。 + - dev (开发分支):汇集了最新的功能与修复,可能不稳定。推荐给希望体验新功能或参与贡献的开发者。 + + - 下载方式:选择 SSH 或 HTTPS。 + + 说明:若选择 SSH 方式,请确保已在对应代码托管平台配置 SSH Key(可点击界面中的蓝色链接查看详细文档)。 + +3. 选择第一步创建的项目目录 `openvela`,单击右上角 **Select**,如下图所示: + + + +4. 等待项目创建完成,下载进度如下图所示: + + **注意**:下载源码过程耗时较长,请防止电脑进入休眠状态。 + + + +### 3、配置编译参数 + +1. 打开创建完成的 `openvela` 目录: + + + +2. 点击左侧 openvela **帆船**图标,然后点击**配置 (Configure)** 按钮,如下图所示: + + + +3. 选择相应的 `defconfig` 文件及其它可选参数: + + + +## 五、编译与运行 + +### 1、编译项目 + +1. 点击**编译(Build)**按钮,等待构建系统完成编译: + + + +2. 编译完成效果如下图所示: + + + +### 2、运行模拟器 + +1. 点击**运行 (Run)** 按钮,启动模拟器: + + + +2. 在模拟器终端输入 `lvgldemo`,启动 openvela 演示应用: + + + + + +## 六、调试应用 + +1. 单击**调试(Debug)**按钮,系统将启动模拟器并挂载调试进程: + + + +2. 打开源代码文件 `apps/system/ping/ping.c`,在 `main` 函数处设置断点: + + + +3. 在模拟器终端执行 `ping` 命令。系统将运行 Ping 应用并自动命中断点,进入调试模式。 + + + +## 七、开发原生应用 + +### 1、创建应用 + +1. 在插件界面点击**创建原生应用(Create Native App):** + + + +2. 选择应用模板: + + + +3. 输入项目名称(例如 `Whackmole1`): + + + +### 2、编译与运行新应用 + +1. 创建完成后,VS Code 会自动定位到新应用的源代码目录。 + + + +2. 重新执行**编译 (Build)** -> **运行 (Run)**。 +3. 在模拟器终端输入应用名称(如 `Whackmole1`)启动新应用。 + +## 八、资源管理与可视化预览 + +openvela 插件提供了强大的可视化预览功能,支持图片、字体和二进制资源,并支持模拟器文件系统挂载。 + + + +### 1、挂载数据卷 + +首次使用 `openvela` 仓库时,系统会自动弹出终端执行挂载命令,将 `vela_data.bin` 挂载到本地目录。 + + + +开发者可通过右键菜单手动管理挂载状态: + +- 挂载 openvela:执行挂载。 + + + + + +- 重新挂载 openvela:当模拟器中文件发生变化(例如执行了 `adb push`)时,需执行此操作以刷新文件系统。 + + + +- 卸载 openvela:断开挂载连接。 + +### 2、文件预览 + +支持普通图片、`.bin`、`.ttf` 等格式的预览(支持绝对路径与相对路径)。 + + + +### 3、悬浮 (Hover) 预览 + +**代码资源预览**:鼠标悬停在资源路径字符串上时,将显示资源缩略图。 + + + + + +### 4、调试时变量预览 + +在调试模式下,鼠标悬停在变量上可获取当前值并进行预览。 + +> **操作技巧**:按住 `Alt` 键可在“调试值悬浮显示”和“普通资源悬浮显示”之间切换。 + + + + + +### 5、配置预览基准目录 + +1. 点击 VS Code 的**设置 (Settings)** 按钮(或使用快捷键 `Ctrl+,`)。 +2. 在左侧菜单找到 **Extensions(扩展)并选择 AIoT Image Preview**。 +3. 设置 `Base Dir` 参数以适配不同环境(如 simulator 版本)。 + +