milkv-duo交叉编译环境搭建

参考

GitHub - milkv-duo/duo-buildroot-sdk: Milk-V Duo Official buildroot SDK

CV180X/CV181X SDK 编译及使用说明 ‒ SDKCompilationandUsageGuide master 文档

过程

创建docker环境

docker run -it \
--privileged=true --cap-add=ALL \
--name milkv_env \
-v /home/luo/locke/milkv_duo:/work \
-v /lib/modules:/lib/modules \
-v /dev:/dev \
ubuntu:20.04 /bin/bash

安装基本环境

apt update
apt install git wget sudo vim rsync pkg-config unzip dosfstools mtools e2fsprogs genext2fs
sudo apt-get install build-essential ninja-build bc wget curl git gcc slib automake autoconf libtool libssl-dev squashfs-tools android-sdk-libsparse-utils android-sdk-ext4-utils jq cmake python3-distutils tclsh scons parallel tree python3-dev python3-pip device-tree-compiler libssl-dev cpio squashfs-tools fakeroot libncurses5 flex dosfstools bison 

拉取源码

git clone https://ghproxy.com/https://github.com/milkv-duo/duo-buildroot-sdk.git

运行脚本

./build_milkv.sh

报错:cmake版本过低

 ELF       platform/generic/firmware/payloads/test.elf
 OBJCOPY   platform/generic/firmware/payloads/test.bin
 OBJCOPY   platform/generic/firmware/fw_dynamic.bin
 OBJCOPY   platform/generic/firmware/fw_jump.bin
 OBJCOPY   platform/generic/firmware/fw_payload.bin
make[1]: Leaving directory '/work/duo-buildroot-sdk/opensbi'
  [TARGET] rtos
cd /work/duo-buildroot-sdk/freertos/cvitek && ./build_cv180x.sh
/work/duo-buildroot-sdk/freertos/cvitek/build/task /work/duo-buildroot-sdk/freertos/cvitek
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.16.5 or higher is required.  You are running version 3.16.3


-- Configuring incomplete, errors occurred!
make: *** [scripts/rtos.mk:3: rtos] Error 1
Error: Build board milkv-duo failed!

编译安装cmake3.16.5以上版本的

设置环境变量

export PATH="/usr/local/bin/:$PATH"
/usr/local/bin/cmake

再次运行脚本

完成编译!!