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
14 changes: 7 additions & 7 deletions en/quickstart/openvela_macos_quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ After installation, you can run `repo --version` to verify it.
This method requires you to add your SSH public key to your GitHub account first. Please refer to the [official GitHub documentation](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).

```bash
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

- Method 2: HTTPS

```bash
repo init -u https://github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml
repo init -u https://github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

#### Option B: Download from Gitee
Expand All @@ -133,13 +133,13 @@ After installation, you can run `repo --version` to verify it.
This method requires you to add your SSH public key to your Gitee account first. Please refer to the [official Gitee documentation](https://gitee.com/help/articles/4191).

```bash
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- Method 2: HTTPS

```bash
repo init -u https://gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init -u https://gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

#### Option C: Download from GitCode
Expand All @@ -149,16 +149,16 @@ After installation, you can run `repo --version` to verify it.
This method requires you to add your SSH public key to your GitCode account first. Please refer to the [official GitCode documentation](https://docs.gitcode.com/docs/help/home/user_center/security_management/ssh).

```bash
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- Method 2: HTTPS

```bash
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

3. Run the sync command. `repo` will download all relevant source code repositories according to the manifest file (`openvela.xml`).
3. Run the sync command. `repo` will download all relevant source code repositories according to the manifest file (`trunk-5.4.xml`).

```Bash
repo sync -c -j8
Expand Down
14 changes: 7 additions & 7 deletions en/quickstart/openvela_ubuntu_quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ After installation, you can run `repo --version` to verify it.
This method requires you to add your SSH public key to your GitHub account first. Please refer to the [official GitHub documentation](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).

```bash
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --git-lfs
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

- Method 2: HTTPS

```bash
repo init -u https://github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --git-lfs
repo init -u https://github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

#### Option B: Download from Gitee
Expand All @@ -98,13 +98,13 @@ After installation, you can run `repo --version` to verify it.
This method requires you to add your SSH public key to your Gitee account first. Please refer to the [official Gitee documentation](https://gitee.com/help/articles/4191).

```bash
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- Method 2: HTTPS

```bash
repo init -u https://gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init -u https://gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

#### Option C: Download from GitCode
Expand All @@ -114,16 +114,16 @@ After installation, you can run `repo --version` to verify it.
This method requires you to add your SSH public key to your GitCode account first. Please refer to the [official GitCode documentation](https://docs.gitcode.com/docs/help/home/user_center/security_management/ssh).

```bash
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- Method 2: HTTPS

```bash
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

3. Execute the sync command. `repo` will download all related source code repositories according to the manifest file (`openvela.xml`).
3. Execute the sync command. `repo` will download all related source code repositories according to the manifest file (`trunk-5.4.xml`).

```bash
repo sync -c -j8
Expand Down
83 changes: 24 additions & 59 deletions zh-cn/quickstart/openvela_macos_quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ sudo mv repo /usr/local/bin
此方式需要您先将 SSH 公钥添加至您的 GitHub 账户,请参考 [GitHub 官方文档](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)。

```bash
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

- 方式二:HTTPS

```bash
repo init -u https://github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml
repo init -u https://github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

#### 选项 B:从 Gitee 下载
Expand All @@ -133,13 +133,13 @@ sudo mv repo /usr/local/bin
此方式需要您先将 SSH 公钥添加至您的 Gitee 账户,请参考 [Gitee 官方文档](https://gitee.com/help/articles/4191)。

```bash
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- 方式二:HTTPS

```bash
repo init -u https://gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init -u https://gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

#### 选项 C:从 GitCode 下载
Expand All @@ -149,71 +149,38 @@ sudo mv repo /usr/local/bin
此方式需要您先将 SSH 公钥添加至您的 GitCode 账户,请参考 [GitCode 官方文档](https://docs.gitcode.com/docs/help/home/user_center/security_management/ssh)。

```bash
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- 方式二:HTTPS

```bash
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

3. 执行同步命令,`repo` 将根据清单文件 (`openvela.xml`) 下载所有相关的源代码仓库。
3. 执行同步命令,repo 将根据清单文件 (`trunk-5.4.xml`) 下载所有相关的源代码仓库。

```Bash
```bash
repo sync -c -j8
```

## 步骤三:编译源代码

完成源代码下载后,请在 openvela 根目录下执行以下编译步骤。

### 1. 设置环境变量

执行以下命令,将预编译的工具链路径添加到当前终端会话的环境变量中。

```Bash
uname_s=$(uname -s | tr '[A-Z]' '[a-z]')
uname_m=$(uname -m | sed 's/arm64/aarch64/g')
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** 模式,该模式将编译产物与源代码分离,以保持源码目录的整洁。
![alt text](./figures/004.png)

运行以下 `cmake` 命令来配置项目。此命令将:
> **操作提示**
>
> - 首次同步耗时较长,具体时间取决于您的网络状况和磁盘性能。
> - 若因网络问题中断,可重复执行 `repo sync` 进行增量同步。

- 在 `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)
完成源代码下载后,请在 openvela 根目录下执行以下编译步骤。

### 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
```

> **操作技巧**
Expand All @@ -222,33 +189,31 @@ cmake --build cmake_out/goldfish-arm64-v8a-ap -t menuconfig
> - 按 `空格键` 可切换选中状态(启用/禁用/模块化)。
> - 配置完成后,选择 **Save** 保存并退出。

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

### 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)
<img src="./figures/007.png" alt="" width="75%">

## 步骤四:运行模拟器

在 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)
<img src="./figures/008.png" alt="" width="75%">

## 后续步骤

Expand Down
14 changes: 7 additions & 7 deletions zh-cn/quickstart/openvela_ubuntu_quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ sudo mv repo /usr/local/bin
此方式需要您先将 SSH 公钥添加至您的 GitHub 账户,请参考 [GitHub 官方文档](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)。

```bash
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --git-lfs
repo init -u ssh://git@github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

- 方式二:HTTPS

```bash
repo init -u https://github.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --git-lfs
repo init -u https://github.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --git-lfs
```

#### 选项 B:从 Gitee 下载
Expand All @@ -98,13 +98,13 @@ sudo mv repo /usr/local/bin
此方式需要您先将 SSH 公钥添加至您的 Gitee 账户,请参考 [Gitee 官方文档](https://gitee.com/help/articles/4191)。

```bash
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init --u ssh://git@gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- 方式二:HTTPS

```bash
repo init -u https://gitee.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init -u https://gitee.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

#### 选项 C:从 GitCode 下载
Expand All @@ -114,16 +114,16 @@ sudo mv repo /usr/local/bin
此方式需要您先将 SSH 公钥添加至您的 GitCode 账户,请参考 [GitCode 官方文档](https://docs.gitcode.com/docs/help/home/user_center/security_management/ssh)。

```bash
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init -u ssh://git@gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

- 方式二:HTTPS

```bash
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk-5.4 -m openvela.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
repo init -u https://gitcode.com/open-vela/manifests.git -b trunk -m tags/trunk-5.4.xml --repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ --git-lfs
```

3. 执行同步命令,repo 将根据清单文件 (`openvela.xml`) 下载所有相关的源代码仓库。
3. 执行同步命令,repo 将根据清单文件 (`trunk-5.4.xml`) 下载所有相关的源代码仓库。

```bash
repo sync -c -j8
Expand Down
Loading