We will cross compile L5.4.3_1.0.0 on ubuntu18.04 LTS platform in three steps.
1. Installing Ubuntu 18.04 to vmplayer14 & Configuring Ubuntu 18.04 LTS
2. Compiling L5.4.3_1.0.0 BSP According to Steps in i.MX_Yocto_Project_User's_Guide.pdf
3. Handling tensorflow-lite compilation errors.
No.1 Installing Ubuntu 18.04 to vmplayer14 & Configuring Ubuntu 18.04 LTS
1. Install 18.04 on vmplayer
After installation is done, root user should be set at first.
# sudo passwd root
Then follow these steps to configuration ubuntu 18.04 for environment of compiliation
--Changing sources of ubuntu 18.04 mirror
If you are Chinese users, you can do the step, which can improve your system performance.
# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# sudo geit /etc/apt/source.list
I.MX customers outside China do not need to modify Ubuntu source list, or can modify it to local mirror site of Ubuntu 18.04, which can improve the speed of software upgrade.
Delet all sources and copy following lines here, Then save it and exit
|Update ubuntu source|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
Then running these 2 commands to update sources and packages
# sudo apt-get update
# sudo apt-get upgrade
2. Installing packages for compiliation
|Packages For Compiling BSP|
# sudo apt-get install flex bison gperf build-essential zlib1g-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev tofrodos python-markdown libxml2-utils xsltproc
# sudo apt-get install uuid-dev:i386 liblzo2-dev:i386 gcc-multilib g++-multilib subversion openssh-server openssh-client uuid uuid-dev zlib1g-dev liblz-dev lzop liblzo2-2 liblzo2-dev git-core curl
# sudo apt-get install u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-compiler aptitude libcurl4-openssl-dev nss-updatedb
# sudo apt-get install chrpath texinfo gawk cpio diffstat
No.2 Compiling L5.4.3_1.0.0 BSP According to Steps in i.MX_Yocto_Project_User's_Guide.pdf
The detailed BSP compilation steps are given in i.MX_Yocto_Project_User's_Guide.pdf. Here are just some tips and simple steps.
For Chinese customers, the system may not respond when the repo init or repo sync command is executed after obtaining the repo script. Detailed description is below:
(1)Getting repo script
# mkdir ~/bin (this step may not be needed if the bin folder already exists)
# curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
# chmod a+x ~/bin/repo
# export PATH=~/bin:$PATH
(2)Getting Yocto source
# mkdir imx-yocto-bsp
# cd imx-yocto-bsp
# repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.3-1.0.0.xml
# repo sync
After running repo init or repo sync, you may encounter a situation where there is no progress for a long time, and repo sync stops there without any prompt. This may be caused by googlesource site being inaccessible.
At this time, you can modify the googlesource URL to the URL of Tsinghua University.
# gedit ./repo
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
REPO_URL = 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
Save and exit.
Then run “repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.3-1.0.0.xml”.
or repo sync
No.3 Handling tensorflow-lite compilation errors
If you encounter a tensorflow-lite compilation error during the compilation process, the following processing methods may be helpful to you.
Compiling tensorflow-lite requires three steps: fetching packages, configuring environment, and compiling code.
During the configuring environment, the following 8 software packages need to be downloaded. If any of the 8 files are not successfully downloaded, an error will be reported and compilation will be terminated.
If you encounter this problem, you can refer to the following methods to solve it.
Open the file with editor:
Save and exit.
Don’t run “bitbake tensorflow-lite -c cleanall before you modify it”, otherwise files will be deleted.
Then try to compile tensorflow-lite like below:
# bitbake tensorflow-lite -c compile
At the same time, we can open this directory and check if the following directories are created. If these 8 directories are successfully created, it means that links we modified are no problem.
After tensorflow-lite is successfully built, we can continue to compile full images.
# bitbake imx-image-full
NXP TIC team