新安装的Ubuntu18.04.5搭建编译海思SDK环境(以Hi3516CV500_SDK_V2.0.3.0为例)
新安装的Ubuntu18.04.5搭建编译海思SDK环境(以Hi3516CV500_SDK_V2.0.3.0为例)20210408安装的Ubuntu18.04.5虚拟机只是粗糙的安装了以下工具,但是想要开始编译海思的SDK环境还是属于没配好的。1.net-tool支持ifconfig命令2.vim3.nfs4.samba5.ssh6.screen7.ctags解压交叉编译链arm-himix410
4.新安装的Ubuntu18.04.5搭建编译海思SDK环境(以Hi3516CV500_SDK_V2.0.3.0为例)
一、新环境简介
20210408安装的Ubuntu18.04.5虚拟机只是粗糙的安装了以下工具,但是想要开始编译海思的SDK环境还是属于没配好的。
1.net-tool支持ifconfig命令
2.vim
3.nfs
4.samba
5.ssh
6.screen
7.ctags
二、解压SDK包
解压交叉编译链arm-himix410-linux.tgz并安装好
解压海思的SDK:Hi3516CV500_SDK_V2.0.3.0.tgz
因为是新安装的Ubuntu18.04.5,其中
执行./sdk.unpack解压SDK的时候报错:
./sdk.unpack: 2: ./sdk.unpack: source: not found
./sdk.unpack: 4: ./sdk.unpack: echo_info: not found
./sdk.unpack: 6: ./sdk.unpack: warn: not found
./sdk.unpack: 7: ./sdk.unpack: warn: not found
./sdk.unpack: 8: ./sdk.unpack: echo_info: not found
./sdk.unpack: 17: ./sdk.unpack: echo_info: not found
./sdk.unpack: 18: ./sdk.unpack: echo_info: not found
./sdk.unpack: 29: ./sdk.unpack: echo_info: not found
./sdk.unpack: 31: ./sdk.unpack: run_command_progress_float: not found
./sdk.unpack: 29: ./sdk.unpack: echo_info: not found
./sdk.unpack: 31: ./sdk.unpack: run_command_progress_float: not found
./sdk.unpack: 29: ./sdk.unpack: echo_info: not found
./sdk.unpack: 31: ./sdk.unpack: run_command_progress_float: not found
./sdk.unpack: 29: ./sdk.unpack: echo_info: not found
./sdk.unpack: 31: ./sdk.unpack: run_command_progress_float: not found
./sdk.unpack: 29: ./sdk.unpack: echo_info: not found
./sdk.unpack: 31: ./sdk.unpack: run_command_progress_float: not found
./sdk.unpack: 29: ./sdk.unpack: echo_info: not found
./sdk.unpack: 31: ./sdk.unpack: run_command_progress_float: not found
解决方案:
sudo dpkg-reconfigure dash
按向右键选择回车保存退出
三、编译u-boot
解压完成后得到 Hi3516CV500_SDK_V2.0.3.0 目录
cd Hi3516CV500_SDK_V2.0.3.0/open_source/u-boot/
tar -xf u-boot-2020.01.tar.bz2
cd u-boot-2020.01
patch -p1 < …/hisi_u-boot-2020.01.patch
make ARCH=arm CROSS_COMPILE=arm-himix410-linux- hi3516cv500_smp_defconfig
make ARCH=arm CROSS_COMPILE=arm-himix410-linux- -j 20
执行make ARCH=arm CROSS_COMPILE=arm-himix410-linux- hi3516cv500_smp_defconfig 时分别报错,如下:
报错1:
HOSTCC scripts/basic/fixdep
/bin/sh: 1: cc: not found
scripts/Makefile.host:97: recipe for target ‘scripts/basic/fixdep’ failed
make[2]: *** [scripts/basic/fixdep] Error 127
Makefile:460: recipe for target ‘scripts_basic’ failed
make[1]: *** [scripts_basic] Error 2
解决方案:
sudo apt-get install build-essential -y
报错2:
YACC scripts/kconfig/zconf.tab.c
/bin/sh: 1: bison: not found
scripts/Makefile.lib:226: recipe for target ‘scripts/kconfig/zconf.tab.c’ failed
make[1]: *** [scripts/kconfig/zconf.tab.c] Error 127
Makefile:541: recipe for target ‘hi3516cv500_smp_defconfig’ failed
make: *** [hi3516cv500_smp_defconfig] Error 2
解决方案:
sudo apt-get install bison -y
报错3:
YACC scripts/kconfig/zconf.tab.c
LEX scripts/kconfig/zconf.lex.c
/bin/sh: 1: flex: not found
scripts/Makefile.lib:218: recipe for target ‘scripts/kconfig/zconf.lex.c’ failed
make[1]: *** [scripts/kconfig/zconf.lex.c] Error 127
Makefile:541: recipe for target ‘hi3516cv500_smp_defconfig’ failed
make: *** [hi3516cv500_smp_defconfig] Error 2
解决方案:
sudo apt-get install flex -y
执行make ARCH=arm CROSS_COMPILE=arm-himix410-linux- -j 20时分别报错,如下:
-bash: /opt/hisi-linux/x86-arm/arm-himix410-linux/bin/arm-himix410-linux-gcc: No such file or directory
解决方案:
sudo apt-get install lib32z1-dev -y
至此u-boot已经能编译成功。
三、编译kernel
cd Hi3516CV500_SDK_V2.0.3.0/open_source/linux
tar -xf linux-4.19.90.tar.gz
cd linux-4.19.90
patch -p1 < …/hisi_linux-4.19.90.patch
cp arch/arm/configs/hi3516cv500_smp_defconfig .config
make ARCH=arm CROSS_COMPILE=arm-himix410-linux- menuconfig
进行内核的配置
make ARCH=arm CROSS_COMPILE=arm-himix410-linux- uImage
执行make ARCH=arm CROSS_COMPILE=arm-himix410-linux- menuconfig 时分别报错,如下:
错误1:
*
- Unable to find the ncurses package.
- Install ncurses (ncurses-devel or libncurses-dev
- depending on your distribution).
scripts/kconfig/Makefile:228: recipe for target ‘scripts/kconfig/.mconf-cfg’ failed
make[1]: *** [scripts/kconfig/.mconf-cfg] Error 1
Makefile:534: recipe for target ‘menuconfig’ failed
make: *** [menuconfig] Error 2
解决方案:
sudo apt-get install libncurses-dev -y
错误2:
“mkimage” command not found - U-Boot images will not be built
arch/arm/boot/Makefile:98: recipe for target ‘arch/arm/boot/uImage’ failed
make[1]: *** [arch/arm/boot/uImage] Error 1
arch/arm/Makefile:343: recipe for target ‘uImage’ failed
make: *** [uImage] Error 2
解决方案:
sudo apt-get install u-boot-tools -y
至此kernel已经能编译成功。
小结:
sudo apt-get update
sudo dpkg-reconfigure dash
按向右键选择回车保存退出
sudo apt-get install build-essential -y
sudo apt-get install bison -y
sudo apt-get install flex -y
sudo apt-get install lib32z1-dev -y
sudo apt-get install libncurses-dev -y
sudo apt-get install u-boot-tools -y
更多推荐
所有评论(0)