【九联Unionpi Tiger开发套件】开箱及编译环境搭建 原创 精华
开发板详细介绍参考附件九联科技UnionpiTiger开发板使用说明书.pdf
本文主要分享开箱照片、编译环境搭建、及烧录。
1.开箱
1.1 包装盒正面图
拿到快递的时候正面盒子被压到了,从外面看比较明显不过从里面看只有一点点痕迹。
1.2 包装盒背面图
有淘宝链接和资料下载链接(这个是master的源码下载链接,有遇到问题后面会说明),及开发板硬件参数介绍
1.3 全部配件图片
包括核心板、扩展板、摄像头及排线、4.3寸触摸屏及线材两条、电源适配器、Micro USB 数据线、铜柱若干。
1.4 4.3寸触摸屏背面图
1.5 组装点亮
连接摄像头和屏幕上电即可使用
2.编译环境搭建
本人编译环境为win11+WSL2+Ubuntu20.04+MobaXterm(开源SSH工具)
主要参考链接
搭建标准系统环境
步骤整理如下:
2.1 安装所需的库和工具:
建议操作前先更新ubuntu20.04源提高安装效率
2.1.1 换清华源:
备份原来的源/etc/apt/sources.list并编辑
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vi /etc/apt/sources.list
将以下内容复制到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.1.2 添加32位源
使用以下指令添加32位源
sudo dpkg --add-architecture i386
2.1.3 重启并更新系统源
重启并执行以下指令
sudo apt-get update
sudo apt-get upgrade
需要等待一段时间,视网络和电脑速度影响
2.1.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
2.1.5 将python 3.8设置为默认python版本。
方法有多种我这边使用的是先移除原来python的,再做软链接指向python3.8
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3.8 /usr/bin/python
3.源码下载
主要参考以下这个链接
device_unionpi
注意目前要参考以下这个链接,下载OpenHarmony-3.1-Release才能编译过,具体源码下载编译步骤如下文整理
https://gitee.com/algoideas/device_unionpi/tree/OpenHarmony-3.1-Release
这个链接是master的还没有合完整,目前会遇到执行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
3.1 下载前的准备工作
3.1.1 注册码云gitee帐号。
3.1.2 注册码云SSH公钥,请参考码云帮助中心。
3.1.3 配置用户信息。
git和git-lfs前面已安装,这边需要再配置用户信息。
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
3.1.4 执行如下命令安装码云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
3.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相关补丁到openharmony中
./device/unionpi/build/patch-unionpi.sh
3.3 编译指令
./build.sh --product-name a311d --ccache
编译成功提示如下
3.4 生成镜像
./device/unionpi/build/packer-unionpi.sh
生成成功后,在 out/a311d/packages/phone/images/ 目录下将生成 OpenHarmony.img 镜像文件。
镜像生成log截图如下
4 烧写
4.1 安装USB_Burning_Tool工具
工具可以从gitee上获取下载链接
下载后按提示安装即可
4.2 进入烧录模式
有两种手法
4.2.1 ①在断电情况下按住UPDATE按键插上电源
4.2.2 ②在已经通电的情况下按住UPDATE按键,短按Reset重启
4.4 开始烧录
步骤参考USB_Burning_Tool右下角说明
4.4.1 OTG接口连接
用将Micro USB 数据线将开发板的USB_OTG接口连接到电脑
4.4.2 导入烧录包
从“文件”-“导入烧录包”选择加载要烧录的镜像文件,导入后会有校验提示。等待提示结束,右上角开始从灰色不可选变为可以点击状态
4.4.3 点击开始
点击USB_Burning_Tool右上侧开始按钮,
开始烧录烧录过程状态会有紫色进度条提示当前进度。
4.4.4 烧录成功
大概需要8分钟烧录,数据线电脑配置不一样可能会有影响,烧录成共提示 100%,需要手动按reset键或者插拔电源重启
以上九联Unionpi Tiger开发套件开箱及编译环境搭建编译及烧录分享,感谢阅读。
OpenHarmony又有新板子玩了,感谢楼主分享。
你好,请问在运行补丁文件的脚本时候显示这个正常吗?
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -Naur a/applications/standard/hap/BUILD.gn b/applications/standard/hap/BUILD.gn
|--- a/applications/standard/hap/BUILD.gn 2022-04-02 17:08:49.862413467 +0800
|+++ b/applications/standard/hap/BUILD.gn 2022-03-31 12:13:45.619816000 +0800
--------------------------
File to patch:
我直接一路回车
最后编译报错
nebula@Nebula:/media/nebula/tiger/openharmony$ ./build.sh --product-name a311d --ccache
++++++++++++++++++++++++++++++++++++++++
2022-07-10 17:20:34
--product-name a311d --ccache
[OHOS INFO] Set cache size limit to 50.0 GB
[OHOS INFO] root_out_dir=//out/a311d
[OHOS INFO] root_build_dir=//out/a311d
[OHOS INFO] root_gen_dir=//out/a311d/gen
[OHOS INFO] current_toolchain=//build/toolchain/ohos:ohos_clang_arm
[OHOS INFO] host_toolchain=//build/toolchain/linux:clang_x64
[OHOS INFO]
[OHOS INFO] args: Namespace(build_platform_name='phone', build_xts=False, example_subsystem_file=None, gn_root_out_dir='/media/nebula/tiger/openharmony/out/a311d', ignore_api_check=['xts', 'common', 'developertest'], os_level='standard', platforms_config_file='/media/nebula/tiger/openharmony/out/preloader/a311d/platforms.build', scalable_build=False, source_root_dir='/media/nebula/tiger/openharmony/', subsystem_config_file='/media/nebula/tiger/openharmony/out/preloader/a311d/subsystem_config.json', target_cpu='arm', target_os='ohos')
[OHOS INFO]
[OHOS INFO] build configs generation is complete.
[OHOS INFO] ERROR at //foundation/ace/ace_engine/adapter/ohos/build/config.gni:15:1: Unable to load "/media/nebula/tiger/openharmony/foundation/graphic/standard/graphic_config.gni".
[OHOS INFO] import("//foundation/graphic/standard/graphic_config.gni")
[OHOS INFO] ^--------------------------------------------------------
[OHOS INFO] See //foundation/ace/ace_engine/adapter/ohos/build/platform.gni:22:7: whence it was imported.
[OHOS INFO] import("config.gni")
[OHOS INFO] ^------------------
[OHOS INFO] See //foundation/ace/ace_engine/ace_config.gni:129:5: whence it was imported.
[OHOS INFO] import("$ace_root/adapter/$item/build/platform.gni")
[OHOS INFO] ^--------------------------------------------------
[OHOS INFO] See //foundation/ace/napi/BUILD.gn:127:3: whence it was imported.
[OHOS INFO] import("//foundation/ace/ace_engine/ace_config.gni")
[OHOS INFO] ^--------------------------------------------------
[OHOS INFO] See //build/ohos/ohos_part.gni:25:16: which caused the file to be included.
[OHOS INFO] _deps += [ get_label_info(module_label, "label_with_toolchain") ]
[OHOS INFO] ^--------------------------------------------------
[OHOS INFO]
[OHOS INFO] product_name : , a311d
[OHOS INFO] is_mmi_have_libinput = true
[OHOS INFO] is_mmi_have_hdf = false
[OHOS INFO] is_mmi_have_debug = false
[OHOS INFO] mmi_enable_combinationkey = true
[OHOS INFO] mmi_enable_pointer_drawing = true
[OHOS INFO] ---------------------------------------------
[OHOS INFO] ccache summary:
[OHOS INFO] cache hit (direct) : 0
[OHOS INFO] cache hit (preprocessed) : 0
[OHOS INFO] cache miss : 0
[OHOS INFO] hit rate: 0.00%
[OHOS INFO] mis rate: 0.00%
[OHOS INFO] ---------------------------------------------
[OHOS INFO] file: /media/nebula/tiger/openharmony/out/a311d/.ninja_log not exists
[OHOS INFO] parse file fail
[OHOS ERROR] Please check build log in /media/nebula/tiger/openharmony/out/a311d/build.log
=====build error=====
开发板哪里弄的呀
源码是什么版本用下载指令贴下?确认下patch和ohos的版本是否对齐。
华为生态市场有卖https://developer.huawei.com/consumer/cn/market/prod-detail?productId=05b919bb38544780ad75294ccdf28a2a&shopId=175592cdc1a34863894f2bb5900fcda4&ha_source=427-SY-forum&ha_sourceId=89000074
屏幕锁定怎么解锁