1. 前置作業
在進行建立cross compiler的環境前,或許您的電腦缺少了相關套件,請依下面的指示將套件安裝完畢,再進行建立cross compiler的環境
a. 建立cross compile path到環境變數
PATH = <YOUR_ARM_TOOLCHAIN_PATH>:$PATH
使用修改.bashrc來設定環境變數, 此修改只需關掉Terminal再開啟後,就都會被設定
EX: .bashrc的路徑是在"/home/au0110/.bashrc"
在檔案最後面加入
export PATH=/share/sunplus_20190523/sunplus/crossgcc/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/bin:$PATH
b. 安裝相關編譯套件
zlib1g-dev libpng-dev libjpeg62-dev libfreetype6-dev libsysfs-dev libsdl1.2-dev x11proto-xext-dev libxext-dev
autoconf automake libtool pkg-config
libjpeg-turbo8 docbook2x libass-dev lib32z1-dev
cmake
u-boot-tools ===>執行mkimage 工具
c. 編譯及安裝flux-1.4.4
此套件在編譯DirectFB圖形庫時需要用到
# wget https://github.com/Distrotech/flux/archive/distrotech-flux-1.4.4.tar.gz
# tar xvf distrotech-flux-1.4.4.tar.gz
# ./configure
# make
# make install
d.編譯及安裝libjpeg-turbo-2.0.1
#git clone https://github.com/libjpeg-turbo/libjpeg-turbo.git
# apt-get install nasm
# cd libjpeg-turbo-2.0.1
# mkdir build
# cd build
# cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DOCDIR=/share/libjpeg_turbo/libjpeg-turbo-2.0.2 -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..
# make -j12
# rm -f /usr/lib/libjpeg.so*
# make install
e. DirectFB 圖形庫編譯
下載 DirectFB 源碼
# git clone https://github.com/Distrotech/DirectFB.git
編譯和安裝fusion
# cd ~/DirectFB
# ./configure
# make
# make install
2. 執行make config,產生rootfs目錄,並選擇板子要跑的格式。
到根目錄下執行
# sudo make config
選擇13,表示我要執行emmc mode。
3. Build GTK+-2.15.5 with directfb backend
# cd application/gtk
# ./build native
# ./build /usr ==>/usr is gtk install rootfs destination path
產生以下壓縮檔,並且解壓到../../rootfs/initramfs/disk/usr目錄下
# tar -C ../../rootfs/initramfs/disk/usr -zxvf .tmp/gtk.tar.gz
4. Build QT
# cd application/qt
# ./build /usr ==>is qt install rootfs destination path
產生以下壓縮檔,並且解壓到../../rootfs/initramfs/disk/usr目錄下
# tar -C ../../rootfs/initramfs/disk/usr -zxvf .tmp/qt.tar.gz
5. Build Opencv
# cd application/opencv
# ./build /usr ==>is qt install rootfs destination path
產生以下壓縮檔,並且解壓到../../rootfs/initramfs/disk/usr目錄
# tar -C ../../rootfs/initramfs/disk/usr -zxvf .tmp/opencv.tar.gz
# tar -C ../../rootfs/initramfs/disk/usr -zxvf .tmp/opencv_samples.tar.gz
6. build the rootfs
modify the rootfs and overlay partition size
# build/isp.sh
將 rootfs 改為0x8000000
7.執行make all,建立imgboot.bin
到根目錄下執行
# sudo make all
在 out/目錄下產生ispboot.bin,將此檔案放置隨身碟進行燒錄動作到emmc。
8. 進入CP chip的root file system,並且開啟測試程式驗證