【九聯(lián)Unionpi Tiger開發(fā)套件】開箱及編譯環(huán)境搭建
??想了解更多關(guān)于開源的內(nèi)容,請訪問:??
開發(fā)板詳細(xì)介紹參考附件??九聯(lián)科技UnionpiTiger開發(fā)板使用說明書.pdf??。
本文主要分享開箱照片、編譯環(huán)境搭建、及燒錄。
一、箱
1、包裝盒正面圖
拿到快遞的時候正面盒子被壓到了,從外面看比較明顯不過從里面看只有一點(diǎn)點(diǎn)痕跡。
2、包裝盒背面圖
有淘寶鏈接和資料下載鏈接(這個是master的源碼下載鏈接,有遇到問題后面會說明),及開發(fā)板硬件參數(shù)介紹。
3、全部配件圖片
包括核心板、擴(kuò)展板、攝像頭及排線、4.3寸觸摸屏及線材兩條、電源適配器、Micro USB 數(shù)據(jù)線、銅柱若干。
4、4.3寸觸摸屏背面圖
5、組裝點(diǎn)亮
連接攝像頭和屏幕上電即可使用。
二、編譯環(huán)境搭建
本人編譯環(huán)境為win11+WSL2+Ubuntu20.04+MobaXterm(開源SSH工具)。
主要參考鏈接。
??搭建標(biāo)準(zhǔn)系統(tǒng)環(huán)境??。
步驟整理如下:
1、安裝所需的庫和工具:
建議操作前先更新ubuntu20.04源提高安裝效率。
(1)換清華源:
備份原來的源/etc/apt/sources.list并編輯。
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vi /etc/apt/sources.list
將以下內(nèi)容復(fù)制到sources.list。
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security multiverse
(2)添加32位源
使用以下指令添加32位源。
sudo dpkg --add-architecture i386
(3)重啟并更新系統(tǒng)源
重啟并執(zhí)行以下指令。
sudo apt-get update
sudo apt-get upgrade
需要等待一段時間,視網(wǎng)絡(luò)和電腦速度影響。
(4)安裝所需的庫和工具
依ubunt版本不同以下會依賴庫會有一些差異,以下依賴庫基于ubunt20.04。
sudo apt-get update && sudo apt-get install binutils binutils-dev git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libc6-dev-amd64-cross lib32ncurses-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3 python3-pip ruby genext2fs device-tree-compiler make libffi-dev e2fsprogs pkg-config perl openssl libssl-dev libelf-dev libdwarf-dev u-boot-tools mtd-utils cpio doxygen liblz4-tool openjdk-8-jre gcc g++ texinfo dosfstools mtools default-jre default-jdk libncurses5 apt-utils wget scons python3-distutils tar rsync git libxml2-dev lib32z1-dev grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5-dev libncursesw5 libstdc++6 gcc-arm-none-eabi vim ssh locales
(5)將python 3.8設(shè)置為默認(rèn)python版本。
方法有多種我這邊使用的是先移除原來python的,再做軟鏈接指向python3.8。
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3.8 /usr/bin/python
三、源碼下載
主要參考以下這個鏈接。
注意目前要參考以下這個鏈接,下載OpenHarmony-3.1-Release才能編譯過,具體源碼下載編譯步驟如下文整理。
https://gitee.com/algoideas/device_unionpi/tree/OpenHarmony-3.1-Release
這個鏈接是master的還沒有合完整,目前會遇到執(zhí)行prebuilt,npm error 暫時先不要用。
https://gitee.com/openharmony-sig/device_unionpi
錯誤提示如下:
npm WARN tar ENOENT: no such file or directory, open '/home/soon/openharmony/developtools/ace-ets2bundle/compiler/node_modules/.staging/mocha-351cb54b/lib/runner.js'
npm ERR! code ETARGET
npm ERR! notarget No matching version found for deccjsunit@1.0.3.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'compiler'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /home/soon/.npm/_logs/2022-05-22T13_44_56_114Z-debug.log
1、下載前的準(zhǔn)備工作
(1)注冊碼云gitee帳號。
(2)注冊碼云SSH公鑰,請參考碼云??幫助中心??。
(3)配置用戶信息。
git和git-lfs前面已安裝,這邊需要再配置用戶信息。
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
(4)執(zhí)行如下命令安裝碼云repo工具。
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/repo
sudo mv ~/repo /usr/bin/repo
chmod a+x /usr/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
2、源碼下載
mkdir openharmony
cd openharmony
repo init -u https://gitee.com/algoideas/unionpi -b OpenHarmony-3.1-Release -m devboard_unionpi.xml --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
./build/prebuilts_download.sh --skip-ssl
# 打入unionpi相關(guān)補(bǔ)丁到openharmony中
./device/unionpi/build/patch-unionpi.sh
3、編譯指令
./build.sh --product-name a311d --ccache
編譯成功提示如下:
4、生成鏡像
./device/unionpi/build/packer-unionpi.sh
生成成功后,在 out/a311d/packages/phone/images/ 目錄下將生成 OpenHarmony.img 鏡像文件。
鏡像生成log截圖如下:
四、燒寫
1、安裝USB_Burning_Tool工具
工具可以從gitee上獲取??下載鏈接??。
下載后按提示安裝即可。
2、進(jìn)入燒錄模式
有兩種手法
(1)①在斷電情況下按住UPDATE按鍵插上電源
(2)②在已經(jīng)通電的情況下按住UPDATE按鍵,短按Reset重啟
4、開始燒錄
步驟參考USB_Burning_Tool右下角說明。
(1)OTG接口連接
用將Micro USB 數(shù)據(jù)線將開發(fā)板的USB_OTG接口連接到電腦。
(2)導(dǎo)入燒錄包
從“文件”-“導(dǎo)入燒錄包”選擇加載要燒錄的鏡像文件,導(dǎo)入后會有校驗提示。等待提示結(jié)束,右上角開始從灰色不可選變?yōu)榭梢渣c(diǎn)擊狀態(tài)。
(3)點(diǎn)擊開始
點(diǎn)擊USB_Burning_Tool右上側(cè)開始按鈕。
開始燒錄燒錄過程狀態(tài)會有紫色進(jìn)度條提示當(dāng)前進(jìn)度。
(4)燒錄成功
大概需要8分鐘燒錄,數(shù)據(jù)線電腦配置不一樣可能會有影響,燒錄成共提示 100%,需要手動按reset鍵或者插拔電源重啟。
以上九聯(lián)Unionpi Tiger開發(fā)套件開箱及編譯環(huán)境搭建編譯及燒錄分享,感謝閱讀。