The HI3518EV200 SDK installs and compiles the OSDR. 1. Development environment
- WINDOWS10 PC + Virtual machine + Pro + Ubuntu16.0.4
2, copy and unzip. Copy the hi3518e_sdk_v1.0.3.0.tgz to the Linux server.
cd ~/sambashare/
cp /mnt/hgfs/winshare/HI3518EV200/Hi3518E_V200R001C01SPC030/01.software/board/Hi3518E_SDK_V1.0.3.0.tgz ./ -f
ls
tar -xvf Hi3518E_SDK_V1.0.3.0.tgz
3. Installation
Go to the hi3518e_sdk_v1.0.3.0 directory and execute the following two commands
source sdk.cleanup Clear SDK
source sdk.unpack decompress SDK
4. Compiling osdrv
Enter the Osdrv directory.
Execute the Distclean command first to ensure that the SDK commands are clean
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 distclean
Execute make all to compile the entire Osdrv directory
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.1 Error occurred
/bin/sh:1: Pushd:not found
Reason:
Cannot push the stack onto the stack, because the pushd command needs to be executed in the bash environment, so the system default shell needs to be modified to bash
Workaround 1
- Step 1.which sh, the result is/bin/sh
- Step 2.ls-l/bin/sh, result sh points to dash
- Step 3.sudo rm/bin/sh
- Step 4.sudo ln-s/bin/bash/bin/sh
- Step 5.ls-l/bin/sh, result sh point to bash
Workaround 2
- Step 1.sudo dpkg-reconfigure Dash "NO"
- Step 2.ls-l/bin/sh, result sh point to bash
Enter Osdrv, continue compiling
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.2 Error occurred
MAKE[2]: Arm-hisiv300-linux-gcc:command not found
Reason
The cross compilation toolchain is not installed.
Due to the limited resources of the embedded single board, the development and debugging tools cannot be run on the single board. Usually, cross-compilation and debugging are required for development and debugging, that is, the form of "host machine + target machine (evaluation board)".
The processors of the host and target are generally different. The host needs to establish a cross-compilation environment suitable for the target. The program is compiled-linked-located on the host computer to get the executable file. Burn the executable file to the target machine by a certain method, and then run it on the target machine. The so-called cross-compilation is also A machine compilation, B machine runs.
The release package provides two compilation toolchains arm-hisiv300-linux and arm-hisiv400-linux, where arm-hisiv300-linux is a uclibc-based toolchain and arm-hisiv400-linux is a glibc-based toolchain. uclibc is much smaller than glibc, so we choose arm-hisiv300-linux.
Workaround
- Step 1, go to the tool chain and the directory where the installer is located: Hi3518e_sdk_v1.0.3.0/osdrv/opensource/toolchain/arm-hisiv300-linux
- Step 2, unzip the toolchain: TAR-XVF arm-hisiv300-linux.tar.bz2
- Step 3, install the toolchain: sudo./cross.install.v300
- Step 4, go to the Mount directory of the cross-compilation toolchain: Cd/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin
- Step 5,ls "found a lot of arm-hisiv300-linux-uclibcgnueabi-xxx compiler toolchain"
- Step 6,file file ARM-HISIV300-LINUX-UCLIBCGNUEABI-GCC "ELF 32-bit LSB executable, which means the cross-compiler toolchain is 32-bit, But I'm using it. The Ubuntu16.04 on the virtual machine is 64-bit, so the 32-bit Compatibility Pack must be installed "
- Step 7,CD: /target/bin
- Step 8,ls "Found there are a lot of arm-hisiv300-linux-xxx compiler toolchain, these are arm-hisiv300-linux-uclibcgnueabi-xxx symbolic links, That's what we're looking for. Arm-hisiv300-linux tool chain, you can use Ls-l to view "
- Step 9,pwd "/opt/hisi-linux/x86-arm/arm-hisiv300-linux/target/bin, remember this path, you need to import this path into the environment variable: See step 9,10"
- Step 10,vi ~/.BASHRC, append export Path=/opt/hisi-linux/x86-arm/arm-hisiv300-linux/target/bin to the end of file: $PAT
- Step 11,source ~/.BASHRC "ensure that the environment variable settings take effect." You can use the Echo $PATH to see if the import was successful "
- Step 12,ping www.baidu.com "ensure virtual function on the Internet"
- Step 13,sudo Aptitude Install LIB32Z1 "NOTE: Before you install any software, make sure the virtual function is online"
- Step 14,sudo Aptitude Install lib32stdc++6-4.8-dbg "NOTE: Before you install any software, make sure the virtual function is online"
To test whether a cross-compilation toolchain has been successfully installed:
Just think about the commands in Ubuntu.
arm-hisiv300-linux-gcc -v
Gcc version 4.8.3 20131202 (prerelease) (Hisilicon_v300) appears, indicating successful installation
Enter Osdrv, continue compiling
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.3 Error occurred
"Mkimage" command not found-u-boot images won't be built
Workaround 1:
- Step 1,CD osdrv/opensource/uboot/u-boot-2010.06
- Step 2,ls "Can see inside Uboot.bin has been generated"
- Step 3,CD Tools "with mkimage.c and Mkimage"
- Step 4,file mkimage "write x86-64-bit architecture, ubuntu16.0.04 is also a x86-64 schema, so you can run on the current virtual machine"
- Step 5,sudo CP Mkimage/usr/local/bin
- Step 6,CD: /.. /
- Step 7,ls "found inside to u-boot-2010.06 folder and U-boot-2010.06.tgz compressed package"
- Step 8,mki[Continuous Press Tabtab] "found the completion of Mkimage, indicating that has been successfully resolved"
Workaround 2:
- Step 1, Ping www.baidu.com make sure the virtual function is online
- Step 2,sudo apt-get Install U-boot-tools
Enter Osdrv, continue compiling
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.4 Error occurred:
Compr_zlib.c:39:18:fatal error:zlib.h:no such file or directory
Workaround
- Step 1,sudo Aptitude Install Zlib1g-dev
Enter Osdrv, continue compiling
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.5 Error occurred:
Serve_image.c:32:18:error:storage size of ' hints ' isn ' t known
Reason
The reason is that the ubuntu operating system version is too high, and the mtd-utils version used by the SDK is too low.
Workaround
Modify the operating system header file /usr/include/netdb.h and comment this macro __USE_XOPEN2K, such as (note that #ifdef and #endif have a one-to-one correspondence)
- Step 1,sudo Vi/usr/include/netdb.h
- Step 2,:set nu "Show line number"
- Step 3,/__use_xopen2k "Search"
- Step 4, will the 79th line of # if defined __use_xopen2k | | Defined __use_xopen_extended and the corresponding 82nd line of the #endif with//commented out
- Step 5,/__use_xopen2k "Search"
- Step 6, line No. 565 of #ifdef __use_xopen2k and No. 681 line of the #endif with//commented out "with: 681 command jump to 681 lines"
Enter Osdrv, continue compiling
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.6 Error occurred:
Mkfs.ubifs/hashtable/hashtable_itr.c:42:1: Error:redefinition of ' Hashtable_iterator_key '
-----------
Makefile:204:recipe for Target ' Hipctools ' failed
Reason:
For problems with the mtd-utils_1.5.0.tar.bz2 library, you can update to mtd-utils_1.5.2.tar.bz2 and recompile.
mtd-utils_1.5.2.tar.bz2: http://nl.archive.ubuntu.com/ubuntu/pool/universe/m/mtd-utils/mtd-utils_1.5.2.orig.tar.bz2
Failed solution "Not recommended, can be skipped"
solve:
Download mtd-utils-1.5.2.tar.bz2, replace mtd-utils-1.5.0.tar.bz2 in the osdrv \ tools \ pc \ jffs2_tool directory,
tar -jcvf mtd-utils-1.5.2.tar.bz2 mtd-utils-1.5.2
Modify the Makefile in this directory at the same time [I do n’t know how to modify it]
The solution is to be verified:
1. You first comment the jffs2_tool part in osdrv / Makefile (no longer compile the source package provided by SDK)
2. Then download mkfs.jffs2 from the source (apt-get install mtd-utils)
3. And put the execution file in the pub / pc directory. [What is the implementation file? ? ? 】
4. Then you compile again under osdrv / (note that the error occurred before cleaning, do not need to clean all, select hipctools_clean)
make OSDRV_CROSS = arm-hisiv300-linux CHIP = hi3518ev200 hipctools_clean
solve:
Download and decompress mtd-utils-1.5.2.tar.bz2 into ubuntu, then enter the directory of mtd,
make
Analysis and Solutions
Summary: After Baidu search and various explorations, I found that I could not solve this problem, so I decided to skip this problem
Analysis
Based on the printed error message analysis, because:
Mkfs.ubifs/hashtable/hashtable_itr.c:42:1: Error:redefinition of ' Hashtable_iterator_key '
-----------
Makefile:204:recipe for Target ' Hipctools ' failed
So to study the ' Hipctools ' part of the total makefile:
hipctools: prepare
@echo "---------task [5] build tools which run on pc"
make -C $(OSDRV_DIR)/tools/pc/mkyaffs2image/
cp $(OSDRV_DIR)/tools/pc/mkyaffs2image/bin/$(YAFFS_TOOL) $(OSDRV_DIR)/pub/bin/pc
make -C $(OSDRV_DIR)/tools/pc/jffs2_tool/
cp $(OSDRV_DIR)/tools/pc/jffs2_tool/mkfs.jffs2 $(OSDRV_DIR)/pub/bin/pc
cp $(OSDRV_DIR)/tools/pc/jffs2_tool/mkfs.ubifs $(OSDRV_DIR)/pub/bin/pc
cp $(OSDRV_DIR)/tools/pc/jffs2_tool/ubinize $(OSDRV_DIR)/pub/bin/pc
Control print error message 1:
---------task [5] build tools which run on pc
Speculation 1:
@echo "---------task [5] build tools which run on PC" This sentence runs successfully
Control print error message 2:
make -C /home/aston/sambashare/Hi3518E_SDK_V1.0.3.0/osdrv/**tools/pc/mkyaffs2image/**
make[1]: Entering directory ‘/home/aston/sambashare/Hi3518E_SDK_V1.0.3.0/osdrv/ ** tools/pc/mkyaffs2image ** ‘
Speculation 2:
make -C $ (OSDRV_DIR) / ** tools / pc / mkyaffs2image / ** [The print message above corresponds to this sentence]
-
- Summary: Make-c $ (osdrv_dir)/tools/pc/mkyaffs2image/ is intended to generate mkyaffs2image100 and MKFS.JFFS2 files.
Analysis 2:
- Step 1, enter the osdrv/tools/pc/mkyaffs2image/mkyaffs2image/directory, and LS, "found there are many. c,.h files, and there are makefile. Speculate that this file is meant to generate something. "
- Step 2, enter osdrv/tools/pc/mkyaffs2image/bin, and LS "found already inside generated mkyaffs2image100 file"
- Step 3, enter osdrv/tools/pc/jffs2_tool/tmp/mtd-utils-1.5.0, and LS "found already inside generated MKFS.JFFS2" "Analysis Makfile, and combined with online information"
Control print error message 3:
******************************** After verification analysis, it is found that errors have started from here
Speculation 2:
cp $ (OSDRV_DIR) / tools / pc / mkyaffs2image / bin / $ (YAFFS_TOOL) $ (OSDRV_DIR) / pub / bin / pc [The print message above corresponds to this sentence]
-
- Summary: The purpose of this sentence: Copy the generated mkyaffs2image100 and MKFS.JFFS2 files to the OSDRV/PUB/BIN/PC directory
Verify that the above statement executed successfully:
- Step 1,CD OSDRV/PUB/BIN/PC
- Step 2,ls "Only mkyaffs2image100 inside"
Solution: First step: Manually execute this sentence [CP $ (Osdrv_dir)/tools/pc/mkyaffs2image/bin/$ (yaffs_tool) $ (osdrv_dir)/PUB/BIN/PC]
- Step 1,CD osdrv/tools/pc/jffs2_tool/tmp/mtd-utils-1.5.0
- Step 2,CP./mkfs.jffs2./. /.. /.. /.. /.. /pub/bin/pc
- Step 3,ls./... /.. /.. /.. /.. /PUB/BIN/PC "Inside Mkfs.jffs2,mkyaffs2image100"
The second step: then osdrv the total makefile inside the Jffs2_tool commented out "with #":
- Step 1,sudo VI Makefile
- Step 2,/jffs2_tool "Search"
#make-C $ (osdrv_dir)/tools/pc/jffs2_tool/
#cp $ (Osdrv_dir)/TOOLS/PC/JFFS2_TOOL/MKFS.JFFS2 $ (osdrv_dir)/PUB/BIN/PC
#cp $ (Osdrv_dir)/tools/pc/jffs2_tool/mkfs.ubifs $ (osdrv_dir)/PUB/BIN/PC
#cp $ (Osdrv_dir)/tools/pc/jffs2_tool/ubinize $ (osdrv_dir)/PUB/BIN/PC
#cp $ (Osdrv_dir)/tools/pc/jffs2_tool/ubi.cfg $ (osdrv_dir)/PUB/BIN/PC
Enter Osdrv, continue compiling
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.7 Error occurred:
Configure:error:ncurses or NCURSESW selected, but library isn't found (--without-ncurses to disable)
Workaround
- Step 1,sudo apt-get Install Libncurses5-dev libncursesw5-dev "First make sure you can ping"
Enter Osdrv, continue compiling
make OSDRV_CROSS=arm-hisiv300-linux CHIP=hi3518ev200 all
4.8 Results
---------Finish osdrv work appears, indicating that the entire OSDRV compilation was successful
- Summary: At this time only mkfs.ubifs/hashtable/hashtable_itr.c:42:1: Error:redefinition of ' Hashtable_iterator_key ' was skipped. Take a snapshot.
4.9 Viewing results:
View:
- cd/home/aston/sambashare/hi3518e_sdk_v1.0.3.0/osdrv/pub/image_uclibc
4.8M ROOTFS_HI3518EV200_128K.JFFS2
4.8M ROOTFS_HI3518EV200_256K.JFFS2
12M ROOTFS_HI3518EV200_2K_4BIT.YAFFS2
16M ROOTFS_HI3518EV200_32M.EXT4
4.8M ROOTFS_HI3518EV200_64K.JFFS2
268K U-boot-hi3518ev200.bin
2.6M uimage_hi3518ev200
5. The entire OSDRV catalog results analysis
Enter Osdrv, after the first make Distclean, the terminal executes the command tree osdrv/
osdrv/
├──makefile---------------------------------osdrv Directory compilation script
├──opensource-------------------------------Store a variety of open stream directory
│├──busybox------------------------------The directory where the BusyBox source code is stored
││└──busybox-1.20.2.tgz
│├──kernel-------------------------------the directory where the kernel source code is stored
││└──linux-3.4.y.tgz
│├──toolchain----------------------------------Store the tool chain directory
││├──arm-hisiv300-linux---------------------Cross-compilation Toolchain
│││├──arm-hisiv300-linux.tar.bz2
│││├──cross.install.v300
│││└──runtime_lib "There are a lot of folders starting with a, there are all lib.tgz files"
│││├──a7_hard_neon-vfpv4
││││└──lib.tgz
│││├──a7_soft
││││└──lib.tgz
││└──arm-hisiv400-linux---------------------Cross-compilation Toolchain
││├──arm-hisiv400-linux.tar.bz2
││├──cross.v400.install
││└──runtime_lib
││├──a7_hard_neon-vfpv4
│││└──lib.tgz
││├──a7_soft
│││└──lib.tgz
│└──uboot--------------------------------------The directory where the Uboot source code is stored
│└──u-boot-2010.06.tgz
├──pub-------------------------------------------to store various images of the directory "as you can see, the original pub is empty, until the" make "after the completion of the compilation of Things"
├──readme_cn.txt
├──readme_en.txt
├──rootfs_scripts--------------------------------Store Root file system authoring script
│└──rootfs.tgz
└──tools---------------------------------------------A catalogue of various tools
├──board-----------------------------------------A variety of single board use tools
│├──e2fsprogs---------------------------------
││├──e2fsprogs-1.41.11.tar.gz
││└──makefile
│├──ethtools
││├──ethtool_6.orig.tar.gz
││└──makefile
│├──gdb
││├──gdb-7.6.tar.bz2
││├──makefile
││└──ncurses-5.9.tar.gz
│├──hifat-------------------------------------FAT file System authoring Tool
││├──glibc
│││├──himount_api.h
│││├──how_to_use_[chs].txt
│││├──how_to_use_[en].txt
│││├──shared
││││├──himount
││││├──libfs_lib.so
││││├──libfuse.so
││││├──libfuse.so.2
││││├──libfuse.so.2.8.3
││││├──libhimount_api.so
││││├──libsdparm.so
││││├──libulockmgr.so
││││├──libulockmgr.so.1
││││└──libulockmgr.so.1.0.1
│││├──src
││││└──hifat-1.0-glibc.tgz
│││└──static
│││├──himount
│││└──libhimount_api.a
││└──uclibc
││├──himount_api.h
││├──how_to_use_[chs].txt
││├──how_to_use_[en].txt
││├──shared
│││├──himount
│││├──libfs_lib.so
│││├──libfuse.so
│││├──libfuse.so.2
│││├──libfuse.so.2.8.3
│││├──libhimount_api.so
│││├──libsdparm.so
│││├──libulockmgr.so
│││├──libulockmgr.so.1
│││└──libulockmgr.so.1.0.1
││├──src
│││└──hifat-1.0-uclibc.tgz
││└──static
││├──himount
││└──libhimount_api.a
│├──mkdosfs-----------------------------------MKDOSFS Tools
││├──dosfstools-3.0.26.tar.gz
││└──makefile
│├──mtd-utils---------------------------------Flash Bare Read and write tool set
││├──makefile
││└──mtd-utils-1.5.0.tar.bz2
│├──reg-tools-1.0.0---------------------------Register reading and writing tool
││├──include
│││├──common----------------------------inside is the common header file
│││└──utils-----------------------------inside is Utils's head file.
││├──makefile------------------------------Tools Makefile
││└──source
││├──common----------------------------inside is the public C source code
││├──tools-----------------------------inside is the C source of tools
││└──utils-----------------------------inside is the utils C source
│└──udev-164---------------------------Udev Toolset
│├──makefile
│├──rootfs
││├──bin
││└──etc
││└──udev
│├──rootfs.tar.bz2
│└──udev-164.tar.bz2
├──makefile
└──PC------------------------------------------A variety of PC use tools
├──cramfs_tool-----------------------------CRAMF File System Authoring Tool
│├──makefile
│└──util-linux-2.22-rc2.tar.bz2
├──ext4_utils
│├──ext4_utils.tar.bz2
│└──makefile
├──jffs2_tool-----------------------------JFFS2 File System Authoring Tool
│├──lzo-2.09.tar.gz
│├──makefile
│└──mtd-utils-1.5.0.tar.bz2
├──lzma_tool------------------------------Lzma Compression Tool
│├──lzma-4.32.7.tar.gz
│└──makefile
├──mkimage_tool---------------------------uimage Production Tools
│├──fastboot.tar.bz2
│└──makefile
├──mkyaffs2image-------------------------YAFFS2 File System Authoring Tool
│├──makefile
│└──mkyaffs2image.tar.bz2
├──nand_production------------------------NAND mass production tool
│├──nand_production_hitool
││└──readme
│└──nand_production_linux
│├──spinand_product
│└──spinand_readme.txt
├──squashfs4.2-------------------------SQUASHFS File System Authoring Tool
│├──makefile
│├──squashfs4.2.tar.bz2
│├──xz-5.0.4.tar.bz2
│└──zlib-1.2.7.tar.bz2
├──ubifs_config---------------------------ulifs File System Configuration Tool
│├──ubi_hi3516cv200.cfg
│├──ubi_hi3518ev200.cfg
│└──ubi_hi3518ev201.cfg
├──uboot_tools----------------------------uboot image maker, xls file and DDR initialization script, FastBoot tool
│├──hi3516cv200-demo-uboot-ddr3-ddrc200mhz-256mb-16bit-cpu600mhz-axi200mhz.log
│├──hi3516cv200-dmeb-uboot-ddr3-ddrc200mhz-256mb-16bit-cpu600mhz-axi200mhz.xls
│├──hi3518ev200-dmeb-uboot-ddr2-ddrc180mhz-64mb-16bit-cpu540mhz-axi200mhz.log
│├──hi3518ev200-dmeb-uboot-ddr2-ddrc180mhz-64mb-16bit-cpu540mhz-axi200mhz.xls
│├──hi3518ev201-dmeb-uboot-ddr2-ddrc180mhz-32mb-16bit-cpu540mhz-axi200mhz.log
│├──hi3518ev201-dmeb-uboot-ddr2-ddrc180mhz-32mb-16bit-cpu540mhz-axi200mhz.xls
│├──mkboot.sh
│├──readme
│├──reg_info_hi3516cv200.bin
│├──reg_info_hi3518ev200.bin
│└──reg_info_hi3518ev201.bin
└──zlib
├──makefile
└──zlib-1.2.7.tar.bz2
5. Analyzing the directory structure of Osdrv
After compiling the osdrv, go to the Osdrv directory: Execute command tree Pub "after the compiled image is placed in the/osdrv/pub directory"
Pub
├──bin
│├──BOARD_UCLIBC--------------------hisiv300 compiled single-board tool
││├──ethtool
││├──flashcp
││├──flash_erase
││├──flash_otp_dump
││├──flash_otp_info
││├──gdb-arm-hisiv300-linux
││├──hifat--------------------------Hifat Tools
│││├──himount_api.h
│││├──how_to_use_[chs].txt
│││├──how_to_use_[en].txt
│││├──shared
││││├──himount
││││├──libfs_lib.so
││││├──libfuse.so
││││├──libfuse.so.2
││││├──libfuse.so.2.8.3
││││├──libhimount_api.so
││││├──libsdparm.so
││││├──libulockmgr.so
││││├──libulockmgr.so.1
││││└──libulockmgr.so.1.0.1
│││├──src
││││└──hifat-1.0-uclibc.tgz
│││└──static
│││├──himount
│││└──libhimount_api.a
││├──mtd_debug
││├──nanddump
││├──nandtest
││├──nandwrite
││└──sumtool
│└──PC "Various PC Tools"
│├──lzma---------------------------------------Lzma Compression Tool
│├──make_ext4fs--------------------------------Ext4 File System Authoring Tool
│├──mkfs.cramfs--------------------------------CRAMF File System Authoring Tool
│├──MKFS.JFFS2------------------------------------JFFS2 File System Authoring Tool
│├──mkimage------------------------------------uimage Production Tools
│├──MKSQUASHFS---------------------------------SQUASHFS File System Authoring Tool
│└──mkyaffs2image100------------------------YAFFS2 File System Authoring Tool
├──IMAGE_UCLIBC---------------------------------------hisiv300 compiled image file
│├──ROOTFS_HI3518EV200_128K.JFFS2------------128K jffs2 File system image
│├──ROOTFS_HI3518EV200_256K.JFFS2-----------256K jffs2 File system image
│├──ROOTFS_HI3518EV200_2K_4BIT.YAFFS2------yaffs File System image
│├──ROOTFS_HI3518EV200_32M.EXT4------------Ext4 File system image
│├──ROOTFS_HI3518EV200_64K.JFFS2-------------64K jffs File system image
│├──u-boot-hi3518ev200.bin--------------------Uboot Mirror
│└──uimage_hi3518ev200-----------------------Kernel Mirror
└──rootfs_uclibc.tgz------------------------hisiv300 compiled Rootfs file system
Summary: The purpose of compiling the entire osdrv is to generate the corresponding uboot,kernel,yaffs to be downloaded to the Development Board.
2. ubuntu16.06 Installation hi3518ev200 SDK