你的位置:首页 > 信息动态 > 新闻中心
信息动态
联系我们

HI3516DV300笔记(一)搭建开发环境

2022/1/1 1:35:53

目录

系统准备

更新软件源

安装依赖包

安装toolchains

安装SDK

解压、展开SDK

下载源码包

编译


开发板:Hi3516DV300

SDK版本: Hi3516CV500R001C02SPC020

现在已经习惯在windows上用WSL linux子系统做开发和测试。懒得开虚拟机。WSL还是挺方便的。

系统准备

更新软件源

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bakcup
sudo vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
sudo apt-get update

安装依赖包

更改SH

sudo dpkg-reconfigure dash

dash->bash 选择no

sudo apt install vim net-tools git lib32stdc++6 libncurses5-dev make gcc lib32z1 
sudo apt install u-boot-tools g++ texinfo texlive gawk libssl-dev openssl 
sudo apt install zlib1g-dev python uuid-dev bison gperf pkg-config

安装toolchains

mkdir -p hi3516

cp arm-himix200-linux.tgz ~/hi3516
cp Hi3516CV500_SDK_V2.0.2.0.tgz ~/hi3516

cd hi3516

解压toolchains

tar -xzf arm-himix200-linux.tgz
rm -f arm-himix200-linux.tgz
cd arm-himix200-linux/
sudo ./arm-himix200-linux.install

等待。。。等待。。。

source /etc/profile
rm -rf arm-himix200-linux/
sudo su
vi ~/.bashrc
export PATH="/opt/hisi-linux/x86-arm/arm-himix200-linux/bin:$PATH"
source ~/.bashrc

测试安装是否成功,编译需要root或sudo权限

 arm-himix200-linux-gcc -v

安装SDK

解压、展开SDK

tar -zxf Hi3516CV500_SDK_V2.0.2.0.tgz
rm -f Hi3516CV500_SDK_V2.0.2.0.tgz
cd Hi3516CV500_SDK_V2.0.2.0
./sdk.unpack

下载源码包

cd osdrv
wget -P opensource/kernel/ https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.9.37.tar.gz
wget -P tools/pc/mkyaffs2image/ https://codeload.github.com/dorigom/yaffs2utils/tar.gz/refs/tags/0.2.9
mv tools/pc/mkyaffs2image/0.2.9 tools/pc/mkyaffs2image/yaffs2utils-0.2.9.tar.gz
wget -P tools/board/gdb/ http://ftp.gnu.org/gnu/gdb/gdb-7.9.1.tar.gz
wget -P tools/board/gdb/ http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
wget -P tools/pc/cramfs_tool/ https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.tar.gz

编译

首次编译就 make all。

在osdrv执行make,会删除修改当前的包,再次解压。所以如果修改了文件,不建议在osdrv下make。