从放弃到入门[二]:海思Hi3516EV200SDK初体验

从放弃到入门[二] 海思Hi3516EV200 SDK初体验

1.编译环境:Ubuntu20.04

2.编译链:arm-himix100-linux

3.环境依赖:

sudo apt-get install make libc6:i386 lib32z1 lib32stdc++6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ texinfo texlive gawk libssl-dev openssl bc u-boot-tools libuuid1:i386 gperf bison zlib1g-dev liblzo2-dev uuid-dev pkg-config

4.SDK版本:

Hi3516EV200R001C01SPC011

5.编译准备:

先执行脚本:sdk.unpack 给SDK解包

由于开源工具的整改,SDK对于部分开源工具不在提供源码包,所以我们需要自行下载处理。需要处理的源码包在SDK包的osdrv下面的readme都有说明。为了偷懒,写了一个简单的补丁脚本来处理这些。

从放弃到入门[二]:海思Hi3516EV200SDK初体验

从放弃到入门[二]:海思Hi3516EV200SDK初体验

这里有些和osdrv下readme有差异的地方会在后面说明原由。

6.编译:

在osdrv下进行整包编译:

make OSDRV_CROSS=arm-himix100-linux CHIP=hi3516ev200 all

在ubuntu14.04中可以直接编译过,但是在18.04和20.04中可能会遇到以下错误。

错误一: fseeko.c: In function rpl_fseeko:` `fseeko.c:110:4: error: #error “Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib.”` `110 | #error “Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib.”` `| ^~~~~` `CC printf-args.o` `CC printf.o` `make[5]: *** [Makefile:1696: fseeko.o] Error 1` `make[5]: *** Waiting for unfinished jobs….` `CC printf-parse.o` `fseterr.c: In function fseterr:` `fseterr.c:78:3: error: #error “Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib.”` `78 | #error “Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib.”` `| ^~~~~
<
解决方法: 修改:osdrv/tools/pc/hi_gzip/Makefile: pushd gzip-1.8;patch -p1 < ../hi_gzip.patch;./configure;make -j12;popd 改为: pushd gzip-1.8;patch -p1 < ../hi_gzip.patch;sed -i s/IO_ftrylockfile/IO_EOF_SEEN/ lib/*.c;echo “#define _IO_IN_BACKUP 0x100” >> lib/stdio-impl.h;./configure;make -j12;popd 错误二: mksquashfs.c: In function ‘create_inode’:` `mksquashfs.c:987:24: error: called object ‘major’ is not a function or function pointer` `987 | unsigned int major = major(buf->st_rdev);` `| ^~~~~` `mksquashfs.c:987:16: note: declared here` `987 | unsigned int major = major(buf->st_rdev);` `| ^~~~~` `mksquashfs.c:988:24: error: called object ‘minor’ is not a function or function pointer` `988 | unsigned int minor = minor(buf->st_rdev);` `| ^~~~~` `mksquashfs.c:988:16: note: declared here` `988 | unsigned int minor = minor(buf->st_rdev);` `| ^~~~~` `mksquashfs.c:1011:24: error: called object ‘major’ is not a function or function pointer` `1011 | unsigned int major = major(buf->st_rdev);` x `| ^~~~~` `mksquashfs.c:1011:16: note: declared here` `1011 | unsigned int major = major(buf->st_rdev);` `| ^~~~~` `mksquashfs.c:1012:24: error: called object ‘minor’ is not a function or function pointer` `1012 | unsigned int minor = minor(buf->st_rdev);` `| ^~~~~` `mksquashfs.c:1012:16: note: declared here` `1012 | unsigned int minor = minor(buf->st_rdev);
<
解决方法: 修改: osdrv/tools/pc/squashfs4.3/Makefile SQUASHFS := squashfs4.3 改为: SQUASHFS := squashfs4.4 这里就是脚本补丁和readme中有差异的地方,为了解决这个错误,我们使用了squashfs4.4而不是squashfs4.3

经过以上两个修改,在ubuntu20.04上就可以完成了SDK的整包编译了。

从放弃到入门[二]:海思Hi3516EV200SDK初体验

7.建议:

重复编译过程中很可能出现以下情况。原因是因为重复打补丁,因此建议如果编译失败时,再次进行编译前建议进行make clean一下,这样就不会出现下面这种情况了。当然,在出现这个情况时也可以选择跳过,小A就是一路Enter下来的。

从放弃到入门[二]:海思Hi3516EV200SDK初体验

8.End

以上就是小A初次编译SDK的体验,总的来说比即将停产的上一代SoC 3518EV200系列的SDK编译起来要顺畅的多。

另外,其实对于遇到的错误,我们可以根据实际情况进行选择修改相应的Makefile进行编译忽略,比如当你不使用squashfs的时候就没有必要来编译生产这个工具。

免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:从放弃到入门[二]:海思Hi3516EV200SDK初体验 https://www.yhzz.com.cn/a/14767.html

上一篇 2023-05-12 11:01:54
下一篇 2023-05-12 11:04:26

相关推荐

联系云恒

在线留言: 我要留言
客服热线:400-600-0310
工作时间:周一至周六,08:30-17:30,节假日休息。