第一季5:Hi3518EV200的环境搭建
主要是安裝SDK,編譯得到燒錄所需的uboot、kernel、rootfs。
- 在osdrv/pub/image_uclibc目錄下得到uboot和uImage
- 根文件系統在osdrv/pub目錄下,若需要制作成鏡像,則執行(注意路徑)osdrv/pub/bin/pc/mkfs.jffs2 -d osdrv/pub/rootfs_uclibc -l -e 0x10000 -o osdrv/pub/image_uclibc/rootfs_uclibc_64k.jffs2
1、下載包含海思SDK的軟件包。https://pan.baidu.com/s/1geV6n1D
2、將Hi3518E V200R001**/01.software/board/Hi3518E_SDK_V1.0.3.0.tgz拷貝到虛擬機合適的目錄(/root/hisisdk),并解壓(使用命令:?tar -zxf Hi3518E_SDK_V1.0.3.0.tgz )
3、解壓SDK:./sdk.cleanup,然后再./sdk.unpack
4、安裝交叉編譯工具鏈
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0#ls
drv ?mpp ?osdrv ?package ?scripts ?sdk.cleanup ?sdk.unpack
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0# cd osdrv/opensource/toolchain/arm-hisiv300-linux(此交叉編譯工具鏈對應uclibc庫,相對比gclibc庫小得多)
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv/opensource/toolchain/arm-hisiv300-linux#ls
arm-hisiv300-linux.tar.bz2 ?cross.install.v300 ?runtime_lib
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv/opensource/toolchain/arm-hisiv300-linux#sudo ./cross.install.v300(該腳本指定了工具鏈的安裝的路徑)
root@ubuntu:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin#export PATH=/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin:$PATH (環境變量的導入)
root@ubuntu:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin# echo $PATH
/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin:/usr/local/arm/arm-2009q3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
root@ubuntu:/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin# vim ~/.bashrc,然后在末行添加上面的環境變量導入語句命令
然后source /etc/profile(否則編譯時會報錯arm-hisiv300-linux-gcc:command not found)
5、編譯整個osdrv
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv#make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
報錯,需要修改sh的命令鏈接,使其鏈接到bash
root@ubuntu:/bin# ls -lh sh
lrwxrwxrwx 1 root root 4 Oct 18 07:43 sh -> dash
root@ubuntu:/bin# sudo dpkg-reconfigure dash ?//在彈出的窗口處選擇no
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
Adding 'diversion of /bin/sh to /bin/sh.distrib by bash'
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash'
root@ubuntu:/bin# ls -lh sh
lrwxrwxrwx 1 root root 4 Jan ?3 19:18 sh -> bash
root@ubuntu:/bin#?
然后再
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv#make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
6、至此,SDK安裝完畢。uboot、kernel、rootfs也可以單獨編譯,詳細參照osdrv/readme_cn.txt
附:還可能出現的錯誤
(1)"mkimage" command not found - U-Boot images will not be built
解決方法如下:
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv#sudo apt-get install uboot-mkimage
Reading package lists... Done
Building dependency tree ? ? ??
Reading state information... Done
Package uboot-mkimage is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
? u-boot-tools
E: Package 'uboot-mkimage' has no installation candidate
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv# sudo apt-get install u-boot-tools
Reading package lists... Done
Building dependency tree ? ? ??
Reading state information... Done
The following NEW packages will be installed:
? u-boot-tools
0 upgraded, 1 newly installed, 0 to remove and 674 not upgraded.
Need to get 59.7 kB of archives.
After this operation, 197 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main u-boot-tools i386 2013.10-3 [59.7 kB]
Fetched 59.7 kB in 1s (51.7 kB/s)?
Selecting previously unselected package u-boot-tools.
(Reading database ... 169087 files and directories currently installed.)
Preparing to unpack .../u-boot-tools_2013.10-3_i386.deb ...
Unpacking u-boot-tools (2013.10-3) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up u-boot-tools (2013.10-3) ...
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv#?
或者,將osdrv/opensource/uboot/u-boot-2010.06/tools目錄下的mkimage拷貝到/usr/local/bin目錄下,即可。
(2)出現mkyaffs2image100錯誤提示:
(因為SDK有在64位系統下編譯的.o文件,而我用的是32位的ubuntu,解決辦法是進入tools/pc/mkyaffs2image/mkyaffs2image目錄下,rm *.o(或者make clean)刪除所有之前編譯的痕跡即可。實際上我們板子上用的是spi flash,適用jffs2文件系統,所以不會做yaffs2文件系統,這個東西要不要都無所謂的。)
make[2]: *** [mkyaffs2image100] Error 1
make[2]: Leaving directory `/root/hisisdk/Hi3518E_S DK_V1.0.3.0/osdrv/tools/pc/mkyaffs2image/mkyaffs2image'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv/tools/pc/mkyaffs2image'
make: *** [hipctools] Error 2
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv# cd ./tools/pc/mkyaffs2image/mkyaffs2image
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv/tools/pc/mkyaffs2image/mkyaffs2image#ls
devextras.h ? ? ?mkyaffs2image.o ? ?oob_config_v100.o ?oob_config_v400.c ?tar ? ? ? ? ?yaffs_ecc.o ? yaffs_packedtags2.c ?yaffs_tagsvalidity.c ?yaffs_trace.h
Makefile ? ? ? ? oob_config.h ? ? ? oob_config_v300.c ?oob_config_v504.c ?yaffs_ecc.c ?yaffs_guts.h ?yaffs_packedtags2.h ?yaffs_tagsvalidity.h ?yportenv.h
mkyaffs2image.c ?oob_config_v100.c ?oob_config_v301.c ?oob_config_v610.c ?yaffs_ecc.h ?yaffs_list.h ?yaffs_packedtags2.o ?yaffs_tagsvalidity.o
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv/tools/pc/mkyaffs2image/mkyaffs2image#make clean
rm -f mkyaffs2image.o yaffs_ecc.o yaffs_packedtags2.o yaffs_tagsvalidity.o mkyaffs2image??? oob_config_v???.o
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv/tools/pc/mkyaffs2image/mkyaffs2image# ls
devextras.h ?mkyaffs2image.c ?oob_config_v100.c ?oob_config_v301.c ?oob_config_v504.c ?tar ? ? ? ? ?yaffs_ecc.h ? yaffs_list.h ? ? ? ? yaffs_packedtags2.h ? yaffs_tagsvalidity.h ?yportenv.h Makefile ? ? oob_config.h ? ? oob_config_v300.c ?oob_config_v400.c ?oob_config_v610.c ?yaffs_ecc.c ?yaffs_guts.h ?yaffs_packedtags2.c ?yaffs_tagsvalidity.c ?yaffs_trace.h
root@ubuntu:~/hisisdk/Hi3518E_SDK_V1.0.3.0/osdrv/tools/pc/mkyaffs2image/mkyaffs2image#make //這里的make只是對錯誤部分的make,其他部分已經是正確的。
(3)bash: osdrv/pub/bin/pc/mkfs.jffs2: No such file or directory
https://blog.csdn.net/QHZM72/article/details/79200213
(4)交叉工具鏈是32bit的而ubuntu是64bit的。
這里我的ubuntu就是32bit的,所以規避了這個問題
(5)錯誤:compr_zlib.c:39:18: fatal error: zlib.h: No such file or directory
因為找不到zlib.h所以編譯錯誤,zlib.h在tools/pc/zlib/tmp/include目錄中有,只需要復制到tools/pc/jffs2_tool/tmp/include目錄中即可,注意同時要將zconf.h也復制過去的。還有要將tools/pc/zlib/tmp/lib目錄下的libz.a ?libz.so ?libz.so.1 ?libz.so.1.2.7等4個文件復制到tools/pc/jffs2_tool/tmp/lib目錄下。
(6)其他錯誤
其他錯誤不需再管,因為此時已經有mkfs.jffs2了,我們只要這個而已,手工將其復制到osdrv/pub/bin/pc目錄下。
總結
以上是生活随笔為你收集整理的第一季5:Hi3518EV200的环境搭建的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 托马斯微积分第十一版_企业微服务第一部分
- 下一篇: 大数据的存储