鸿蒙HI3516-HAP的编译打包和安装

鸿蒙HI3516-HAP的编译打包和安装

1.把源码包编译和烧录

1.vsc导入HI3516项目

https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz

2.SSH连接乌班图进行编译

harmony@harmony-virtual-machine:~$ cd harmony/code/code-hi3516/
harmony@harmony-virtual-machine:~/harmony/code/code-hi3516$ python build.py ipcamera_hi3516dv300 -b debug

3.使用HITool进行烧录

HITool下载地址:http://www.hihope.org/AllDocuments/HiHopeSDK/Hi3516/Hi3516-HiTool.zip

链接:https://pan.baidu.com/s/1GBfKvta60vbnfA7daDCJog 提取码:1mk2 

打开软件,其中读取xml文件需要修改成下面的xml内容,xml里面的路径需要改成自己的,文件在 Z:\harmony\code\code-hi3516\out\ipcamera_hi3516dv300

<?xml version="1.0" encoding="GB2312" ?>
<Partition_Info>

<Part Sel="1" PartitionName="fastboot" FlashType="emmc" FileSystem="none" Start="0"      Length="1M"   SelectFile="D:\img\hmos\u-boot-hi3516dv300.bin"/>

<Part Sel="1" PartitionName="kernel"    FlashType="emmc"  FileSystem="none" Start="1M"  Length="9M"   SelectFile="D:\img\hmos\OHOS_Image.bin"/>

<Part Sel="1" PartitionName="rootfs"    FlashType="emmc"  FileSystem="none" Start="10M" Length="15M" SelectFile="D:\img\hmos\rootfs.img"/>

<Part Sel="1" PartitionName="userfs"    FlashType="emmc"  FileSystem="none" Start="25M" Length="50M" SelectFile="D:\img\hmos\userfs.img"/>

</Partition_Info>

烧录的时候请确认连接串口网口和电源,如果使用串口需要2小时,网口会快很多

4.烧录完成

烧录完成之后HI3516上面就设置和拍照两个了

具体烧录细节请看https://device.harmonyos.com/cn/docs/start/introduce/oem_camera_start_first_example-0000001051610926

打开串口工具可以试一下./bin/camera_app

2.编写HAP包

1.下载DevEco Studio

https://developer.harmonyos.com/cn/develop/deveco-studio#download

2.安装DevEco Studio

具体安装流程请看官网

3.新建项目

填写路径

4.修改试验代码

5.编译生成和预览

点击运行,然后选择下面那个

6.打成HAP包

HAP包的位置在这里

3.烧录HAP包

1.搭建NFS服务器

NFS下载地址链接:https://pan.baidu.com/s/1MYRyKyOsScAyX4naERaFAQ 提取码:fxxr 

使用NFS服务器来传输文件,软件名称:haneWIN NFS,需要在d盘新建文件夹,HI3516只有NFS第三版

然后防火墙打开端口

进入NFS服务器的目录重启所有服务,可以使用NFS客户端测试连接

2.HI3516挂载NFS

挂载文档请看https://device.harmonyos.com/cn/docs/develop/kernel/oem_kernal_shell_cmd_mount-0000001051296194

mount 你的电脑IP:/nfs 挂载目录 nfs

dhclient eth0    // dhcp
mount 192.168.3.x:/nfs /sdcard nfs

3.加入安装程序文件

其中HAP包就是之前编译好的那个,其他四个文件是在

4.安装HAP包

进入sdcard卡,然后进入目录,运行下面两条命令

./sdcard/dev_tools/bin/bm set -s disable
./sdcard/dev_tools/bin/bm install -p xx.hap 

5.完成

猜你喜欢

转载自blog.csdn.net/qq_33259323/article/details/111307192