一、准备工作
(1)获源代码、rootfs.img和npu所需内核
https://github.com/rockchip-toybrick/edgehttps://github.com/rockchip-toybrick/edge
https://meta.box.lenovo.com/v/link/view/37f602e289fb4dc391d4d084548f9617https://meta.box.lenovo.com/v/link/view/37f602e289fb4dc391d4d084548f9617
https://github.com/armbian/linux-rockchip/tree/rk-6.1-rkr1/drivers/rknpuhttps://github.com/armbian/linux-rockchip/tree/rk-6.1-rkr1/drivers/rknpu
(2)在Ubuntu22.04的x86系统搭建编译环境
官方Ubuntu系统安装依赖
sudo apt -y install python lz4 coreutils qemu qemu-user-static python3 \ device-tree-compiler clang bison flex lld libssl-dev bc genext2fs git make结果:一直报错
自己的安装依赖步骤
1、安装lz4
git clone https://github.com/lz4/lz4.git cd lz4 make sudo make install2、安装qemu-user-static
sudo apt-get remove qemu-user-static sudo apt-get install qemu-user-static或者
sudo apt-get install qemu-user-static sudo apt install qemu-user-binfmt sudo update-binfmts3、安装device-tree-compiler
git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git cd dtc make或者
sudo apt-get install device-tree-compiler二、根据官方文档进行编译
参考
https://t.rock-chips.com/wiki/CN/tb-rk3588x/02-2Linux%E5%BC%80%E5%8F%91.html#id2
./edge set #执行如下命令编译生成内核镜像,保存在OUT_DIR目录: ./edge build -k三、烧录镜像
替换images中的recovery.img、boot_linux.img、resource.img、misc.img文件,然后进行烧录。