环境搭建
这里使用docker搭建环境,方便导出复用,镜像链接放在文章末尾
启动docker
docker run -v $PWD/code:/code \
--name=ss928 --workdir=/code \
--restart=always -it ubuntu:18.04 bash
1
2
3
2
3
安装依赖库
apt-get update
apt-get install cmake make libc6-i386 lib32z1 lib32stdc++6 zlib1g-dev \
libncurses5-dev ncurses-term libncursesw5-dev g++ u-boot-tools texinfo texlive gawk \
libssl-dev openssl bc p7zip-full gperf bison flex diffutils git unzip vim -y
apt-get install zlib1g-dev liblzo2-dev uuid-dev pkg-config automake -y
apt-get install texlive -y
1
2
3
4
5
6
7
2
3
4
5
6
7
安装交叉编译工具
tar -xvf aarch64-mix210-linux.tgz
cd aarch64-mix210-linux
./aarch64-mix210-linux.install
1
2
3
2
3
设置环境变量
vim ~/.bashrc
export PATH=/opt/linux/x86-arm/aarch64-mix210-linux/bin:$PATH
source ~/.bashrc
1
2
3
2
3
测试是否安装成功
aarch64-mix210-linux-gcc -v
1
安装riscv交叉编译工具
tar -xvf cc-riscv32-cfg5-musl-20211008-elf.tar.gz
mkdir -p /his
mv cc-riscv32-cfg5-musl-20211008-elf/ /his/
cd cc-riscv32-cfg5-musl-20211008-elf
bash ./install.sh
1
2
3
4
5
2
3
4
5
设置环境变量
vim ~/.bashrc
export PATH=/his/cc-riscv32-cfg5-musl-20211008-elf/cc-riscv32-cfg5-musl-20211008-elf/bin:$PATH
source ~/.bashrc
1
2
3
2
3
编译sdk
拷贝sdk示例代码到环境
mkdir build
cd build
cmake ..
make -j20
1
2
3
4
2
3
4
如果编译完成,把代码移动到板子上运行
导出镜像并保存
docker export -o ss928.tar ss928
gzip ss928.tar # 721M
md5sum ss928.tar.gz
d576aa04c984a87af72d3a4f67727fc8 ss928.tar.gz
1
2
3
4
2
3
4
需要的可自行下载 链接:https://pan.baidu.com/s/13EPy6PnSsB6QAltgLRPXEQ
,提取码:b5hr