Introduction
The default SDK for the Duo series boards is built based on buildroot and is used to generate Duo firmware. Currently, the SDK has two versions: V1 and V2.
- SDK V1 only supports RISC-V core. (This version is recommended for Duo 64M)
- SDK V2 supports both RISC-V and ARM cores. (This version is recommended for Duo256M and DuoS)
It is recommended that Duo 64M use the V1 version of the SDK, mainly because its memory is small. The related AI applications in the V2 version of the SDK cannot currently run normally in Duo 64M.
Buildroot SDK V1
The SDK mainly contains the following parts:
- u-boot: 2021.10
- linux kernel: 5.10.4
- buildroot: 2021.05
- opensbi: 89182b2
Source code: https://github.com/milkv-duo/duo-buildroot-sdk
SDK Directory Structure:
├── build compilation scripts and board configs
├── build.sh one-click compilation script
├── buildroot-2021.05 buildroot source code
├── freertos freertos system
├── fsbl fsbl firmware in prebuilt form
├── install temporary images stored here
├── isp_tuning camera effect parameters
├── linux_5.10 linux kernel
├── middleware self-developed multimedia framework
├── device configuration files for milkv
├── opensbi opensbi library
├── out image generated by Milk-V
├── ramdisk prebuilt ramdisk
└── u-boot-2021.10 u-boot source code
Buildroot SDK V2
The SDK mainly contains the following parts:
- u-boot: 2021.10
- linux kernel: 5.10.4
- buildroot: 2025.02
- opensbi: 89182b2
Source code: https://github.com/milkv-duo/duo-buildroot-sdk-v2
SDK Directory Structure:
├── build compilation scripts and board configs
├── build.sh one-click compilation script
├── buildroot buildroot source code
├── cvi_mpi sophgo multimedia framework
├── device configuration files for milkv
├── freertos freertos system
├── fsbl fsbl firmware in prebuilt form
├── install temporary images stored here
├── isp_tuning camera effect parameters
├── linux_5.10 linux kernel
├── osdrv some peripheral driver source code
├── opensbi opensbi library
├── out image generated by Milk-V
├── tdl_sdk sophgo turnkey deep learning sdk
└── u-boot-2021.10 u-boot source code
Build image
Prepare the Compilation Environment. Using a local Ubuntu system, the officially supported compilation environment is Ubuntu Jammy 22.04.x amd64
only!
If you are using other Linux distributions, we strongly recommend that you use the Docker environment to compile to reduce the probability of compilation errors.
The following describes the compilation methods in the two environments.
In addition, the compilation methods of the V1 and V2 SDKs are basically the same. The following takes the V2 SDK as an example to introduce the SDK compilation steps.
1. Compiled using Ubuntu 22.04
Packages to be installed
Install the packages that compile dependencies:
sudo apt install -y pkg-config build-essential ninja-build automake autoconf libtool wget curl git gcc libssl-dev bc slib squashfs-tools android-sdk-libsparse-utils jq python3-distutils scons parallel tree python3-dev python3-pip device-tree-compiler ssh cpio fakeroot libncurses5 flex bison libncurses5-dev genext2fs rsync unzip dosfstools mtools tcl openssh-client cmake expect python-is-python3
For duo-buildroot-sdk-v2, you also need to install the following tool packages:
sudo pip install jinja2
Get SDK Source Code
git clone https://github.com/milkv-duo/duo-buildroot-sdk-v2.git --depth=1
During the compilation process, Buildroot will automatically download some source packages. SDK V1 has integrated some common source packages and can be compiled directly. In SDK V2, to avoid download failures due to network reasons, you can download the dl.tar
package in advance and extract it to the buildroot
directory:
wget https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/download/dl/dl.tar
tar xvf ./dl.tar -C ./duo-buildroot-sdk-v2/buildroot/