新安装的Ubuntu18.04.5搭建编译海思SDK环境(以Hi3516CV500_SDK_V2.0.3.0为例)

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
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清荣茂多趣味

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值