开发环境
- 我们使用dongshannezha STU 开发板进行开发
- 一台装有ubuntu24的pc或者云服务器
安装docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release apt-transport-https software-properties-common -y
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add –
sudo add-apt-repository “deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable”
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker $USER
sudo apt-get install docker-compose -y
创建工作目录
cd ~/work/Nezha-D1/docker-env
touch Docckerfile docker-compose.yml
cp /etc/ssl/certs/ca-certificates.crt ./
创建nezha d1 开发容器
Dockerfile脚本内容如下:
docker exec -it nezhad1-ubuntu18-env /bin/bash
下载buildroot源码并使用默认配置编译
mkdir -p ~/work/Neza-D1 && cd ~/work/Neza-D1/
git clone https://gitee.com/weidongshan/neza-d1-buildroot.git buildroot-2021
cd buildroot-2021
make nehza-d1_deconfig
make BRJLEVEL=N(N<=2xCPU数量)
却是交叉编译工具链会出现如下错误
git clone https://e.coding.net/weidongshan/Tina-D1/Toolchain.git
cp Toolchain/riscv64-glibc-gcc-thead_20200702.tar.xz dl/toolchain-external-custom/
make BRJLEVEL=N(N<=2xCPU数量)
接下来就是漫长的等待了(摸鱼喝茶时间到)
SD卡镜像文件sdcard.img位于output目录下,使用balena-etcher烧录到SD卡中,SD卡插入开发板上电启动打开串口