从新系统开始搭建HI3516EV300开发环境-编译SDK
作者:互联网
1. 制作U盘启动盘
ubuntu18镜像使用etcher烧写到flash
2. J1900主机刷系统
U盘启动请用右边两个USB口,开机按F11
尽量用以太网,wifi'不稳。
3. 远程登陆
3.1 vnc失败
sudo apt update
sudo apt install tightvncserver
sudo apt install xserver-xorg-core
sudo apt install xrdp xorgxrdp
win10 搜索栏搜索mstsc,打开远程桌面,输入[ip地址:3389],再输入用户密码登录。
3.2 ssh
sudo apt install openssh-server
4. 展开sdk
下载Hi3516EV200R001C01SPC010.rar
unrar x Hi3516EV200R001C01SPC010.rar
4.1 winscp
复制Hi3516EV200_SDK_V1.0.1.0.tgz至主机
4.2 解压
tar -zxf Hi3516EV200_SDK_V1.0.1.0.tgz
4.3 展开SDK包内容
./sdk.cleanup
运行shell的时候出现 ./sdk.unpack: source: not found
ubuntu16.04 系统默认的SH(脚本解析器)为dash,可以使用 ls -l /bin/sh 命令查看
修改默认脚本解析器为bash,方法如下:
1、命令行输入:sudo dpkg-reconfigure dash
2、选择<no>
3、ls -l /bin/sh 查询确认
./sdk.unpack
5 在 linux 服务器上安装交叉编译器 -
买来的海思SDK资料里面有交叉编译器arm-himix100-linux.rar
5.1 依赖
sudo apt-get update && sudo apt-get install -y bzip2 build-essential libc6-dev-i386 ia32-libs lib32z1-dev libncurses5 libncurses5-dev u-boot-tools vim squashfs-tools gettext git zip subversion bc
错误提示:Package ‘ia32-libs’ has no installation candidate
sudo apt-get install lib32z1 lib32ncurses5
sudo apt-get install lib32stdc++6
sudo apt-get update && sudo apt-get install -y bzip2 build-essential libc6-dev-i386 lib32z1-dev libncurses5 libncurses5-dev u-boot-tools vim squashfs-tools gettext git zip subversion bc
5.2 install
把arm-himix100-linux.tgz拷贝到ubuntu18中
tar -zxvf arm-himix100-linux.tgz
cd arm-himix100-linux
sudo ./arm-himix100-linux.install
5.3 添加到环境变量中
export path=/opt/hisi-linux/x86-arm/arm-himix100-linux/bin
source /etc/profile
6. 手动添加源码包
由于开源工具整改,部分开源工具不再提供源码包,客户编译OSDRV时需要自行下载
6.1 kernel 下载
winscp把linuxlinux-4.9.37.tar.gz下载到osdrv/opensource/kernel/
6.2 下载yaffs2utils-0.2.9.tar.gz
cd osdrv/tools/pc/mkyaffs2image/
wget --no-check-certificate https://codeload.github.com/dorigom/yaffs2utils/tar.gz/0.2.9 -O yaffs2utils-0.2.9.tar.gz
6.3 下载gdb-7.9.1.tar.gz
cd osdrv/tools/board/gdb/
wget http://ftp.gnu.org/gnu/gdb/gdb-7.9.1.tar.gz
6.4 下载ncurses-6.0.tar.gz
cd osdrv/tools/board/gdb/
wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
6.5 下载util-linux-2.31.tar.gz
osdrv/tools/pc/cramfs_tool/
wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.31/util-linux-2.31.tar.gz
7. 编译
7.1 开始编译
cd osdrv/
make BOOT_MEDIA=spi CHIP=hi3516ev300 all
7.2 error1 - configure: WARNING: cannot find uuid library required for mkfs.ubifs
/usr/dopi/Hi3516EV200_SDK_V1.0.1.0/package/osdrv/tools/pc/jffs2_tool$ cat readme_cn.txt
7.1.1
sudo apt-get install zlib1g-dev liblzo2-dev uuid-dev pkg-config
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig"
7.1.2
sudo apt-get autoremove automake
cd ~/HI3516
wget ftp://ftp.gnu.org/gnu/automake/automake-1.15.1.tar.gz
7.1.3 编译安装automake1.15.1
tar zxvf automake-1.15.1.tar.gz
cd automake-1.15.1/
sudo apt install autoconf
./configure
make
sudo make install
7.3 error2 -
make[1]: *** [/home/work/Hi3516EV200_SDK_V1.0.1.1/osdrv/tools/board/eudev-3.2.7/tmp/eudev-3.2.7/udevd] Error 1
sudo apt install gperf
7.4 erro3 编译gdb出错
2) On the Linux server, go to the root directory of osdrv and run the following command:
cd tools/board/gdb
rm -rf gdb-7.9.1
tar -xzf gdb-7.9.1.tar.gz
cd gdb-7.9.1
patch -p1 < ../hi-gdb-7.9.1.patch
cd ../
make all
7.5 makeinfo&bison: command not found解决方法
sudo apt-get install texinfo -y
sudo apt-get install bison
8. 额外情况
sdk这里会打补丁,第一次打补丁会生成新的文件,第二次编译sdk,会出现这些情况:按回车即可。
patching file Makefile
patching file mkyaffs2.c
The next patch would create the file oob_config.h,
which already exists! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file oob_config_v100.c,
which already exists! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file oob_config_v100_nand.c,
which already exists! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file oob_config_v610.c,
which already exists! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
9. 编译完毕后提示信息
stage 1: scanning directory '/home/xxjiani3/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub/rootfs_uclibc/'... [done]
scanning complete, total 466 objects.
stage 2: creating image '/home/xxjiani3/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub/hi3516ev300_spi_image_uclibc/rootfs_hi3516ev300_4k_24bit.yaffs2'
[=====================================================================================================================================================================================================================================] 467/466 100%
operation complete,
467 objects in 2139 NAND pages.
~/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv
chmod 644 /home/xxjiani3/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub/hi3516ev300_spi_image_uclibc/rootfs_hi3516ev300_4k_24bit.yaffs2
find /home/xxjiani3/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub/rootfs_uclibc/ -name '*svn' | xargs rm -rf
pushd /home/xxjiani3/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub/rootfs_uclibc; chmod +w usr/bin -R; chmod +w usr/sbin -R; chmod +w sbin -R; popd
~/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub/rootfs_uclibc ~/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv
~/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv
pushd /home/xxjiani3/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub;tar czf rootfs_uclibc.tgz rootfs_uclibc;rm rootfs_uclibc -rf;popd
~/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv/pub ~/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv
~/hi3516/Hi3516EV200_SDK_V1.0.1.0/osdrv
---------finish osdrv work
参考:http://doc.dopi.vip/docs/top/ev300-2
标签:sudo,tar,osdrv,apt,编译,Hi3516EV200,HI3516EV300,SDK 来源: https://blog.csdn.net/qq_27158179/article/details/115603206