YP.Lam | RV1106 开发笔记

RV1106 开发笔记

记录关于 RV1106 烧录、开发环境配置、SDK与Rust绑定相关内容。

最后更新:2024-07-27

CLion 配置

Cmake options 添加

-DCOMPILE_FOR_RV1106_IPC:BOOL=ON -DRKIPC_CROSS_COMPILE=arm-rockchip830-linux-uclibcgnueabihf

Rust 绑定

由于 RV1106 官方 SDK 基于 uclibc,因此 Rust 编译器环境需要基于官方 SDK 手动打包

export PATH=/home/xxx/xxx/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin:$PATH
git clone https://github.com/rust-lang/rust.git
cd rust
git checkout 1.72.1                     
git submodule update --init --recursive
# ./x setup --target=armv7-unknown-linux-uclibceabihf
./x check --target=armv7-unknown-linux-uclibceabihf
./x build library --target=armv7-unknown-linux-uclibceabihf
./x build --stage 2 --target=armv7-unknown-linux-uclibceabihf
mv build/host/stage2 rust-1.72.1-rv1106
tar -cvJf rust-1.72.1-rv1106.tar.xz rust-1.72.1-rv1106

config.toml

changelog-seen = 2
[build]
target = ["armv7-unknown-linux-uclibceabihf"]
build-stage = 2
test-stage = 2
doc-stage = 2
extended = true

[llvm]
download-ci-llvm = false
[rust]
channel = "nightly"
download-rustc = false

[dist]
compression-profile = "balanced"

[target.armv7-unknown-linux-uclibceabihf]
linker = "arm-rockchip830-linux-uclibcgnueabihf-gcc"
cc = "arm-rockchip830-linux-uclibcgnueabihf-gcc"

打包好的工具链可访问github下载: https://github.com/yplam/rv1106-rs/releases/tag/v0.2.0 ,下载后可通过

rustup toolchain link rv1106  path-to/rust-1.72.1-rv1106

https://github.com/yplam/rv1106-rs 项目实现了对 RV1106 SDK 的 Rust 基础功能绑定,方便基于 Rust 开发应用,暂时只实现了 rv1106-sys 关于 rockit, rknpu2 的功能绑定。