鸿蒙Harmony初体验Hi3516DV300

电子狂热者 2022-06-01 10:01:04 7836

鸿蒙发布在gitee上
https://gitee.com/openHarmony
入门指导,以Hi3516DV300为例

https://gitee.com/openharmony/docs/tree/master/quick-start

搭建环境

在ubuntu18.4上,环境搭建可参考gitee上的入门的指导,编译顺利通过后,回头重点理一下:

安装Python
1.sudo apt install -y python
2.sudo apt install -y python3

2
下载编译工具
1.wget http://tools.harmonyos.com/mirrors/gn/1523/linux/gn.1523.tar
2.wget http://tools.harmonyos.com/mirrors/ninja/1.9.0/linux/ninja.1.9.0.tar
3.wget http://tools.harmonyos.com/mirrors/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar
4.wget http://tools.harmonyos.com/mirrors/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

解压

  1. tar -xvf gn.1523.tar -C ~/
  2. tar -xvf ninja.1.9.0.tar -C ~/
  3. tar -xvf llvm-linux-9.0.0-34042.tar -C ~/
  4. tar -xvf llvm-linux-9.0.0-34042.tar -C ~/
    5.tar -xvf hc-gen-0.65-linux.tar -C ~/

设置环境变量:
vim ~/.bashrc
export PATH=~/gn:$PATH
export PATH=~/ninja:$PATH
export PATH=~/llvm/bin:$PATH
export PATH=~/hc-gen:$PATH
export PATH=~/hc-gen:$PATH

最后别忘了 source ~/.bashrc 使得环境变量生效

系统源码编译

下载系统源码

wget http://tools.harmonyos.com/mirrors/os/1.0/code-1.0.tar.gz

解压后,编译:

python build.py ipcamera_hi3516dv300 -b debug

编译需要等多几分钟:

conformance/interfaces/timer_settime/5-1 compile PASSED
make[2]: Entering directory '/usr/dopi/harmony/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative'
conformance/interfaces/timer_settime/speculative/12-3 compile PASSED
conformance/interfaces/timer_settime/speculative/12-1 compile PASSED
conformance/interfaces/timer_settime/speculative/12-2 compile PASSED
make[2]: Leaving directory '/usr/dopi/harmony/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime/speculative'
make[1]: Leaving directory '/usr/dopi/harmony/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/timer_settime'
make: Leaving directory '/usr/dopi/harmony/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces'
[1328/1338] STAMP obj/test/xts/acts/open_posix_testsuite/conformance/interfaces/prebuild_ActsOpenPosixTest.stamp
[1329/1338] ACTION //test/xts/acts/open_posix_testsuite/conformance/interfaces:ActsOpenPosixTest(//build/lite/toolchain:linux_x86_64_clang)
[1330/1338] STAMP obj/test/xts/acts/open_posix_testsuite/conformance/interfaces/ActsOpenPosixTest.stamp
[1331/1338] STAMP obj/test/xts/acts/acts_compoment.stamp
[1332/1338] COPY bin/query.bin suites/acts/resource/tools/query.bin
[1333/1338] STAMP obj/test/xts/acts/query_copy.stamp
[1334/1338] ACTION //test/xts/acts:acts(//build/lite/toolchain:linux_x86_64_clang)
[1335/1338] STAMP obj/test/xts/acts/acts.stamp
[1336/1338] STAMP obj/build/lite/ohos.stamp
[1337/1338] ACTION //build/lite:gen_rootfs(//build/lite/toolchain:linux_x86_64_clang)
[1338/1338] STAMP obj/build/lite/gen_rootfs.stamp
ohos ipcamera_hi3516dv300 build success!

看到 ohos ipcamera_hi3516dv300 build success! 应该是编译完成了。

下载源码时,就疑惑,鸿蒙和liteOS的关系,编译后,还有liteos.bin,疑惑。

烧录

访问 鸿蒙的IDE网站,里面有详细的介绍:

https://device.harmonyos.com/cn/ide

总结下烧录工具:

1.vs code
2.node.js
https://nodejs.org/dist/v12.18.3/node-v12.18.3-x64.msi
3.JDK1.8
链接:https://pan.baidu.com/s/1u6TMZaQ8D-9nIFUSEX1RiA
提取码:ie59

安装教程

https://blog.csdn.net/bestsongs/article/details/104905060

主要是设置环境变量。

  1. npm
    打开window的命令行工具:

    npm install -g @ohos/hpm-cli

5.下载DevEcoDeviceTool-1.0.0
访问:https://device.harmonyos.com/cn/ide这一步,需要华为账户,有点烦。不过里面有指导如何在vs code上安装DevEcoDeviceTool的文档。

安装完成后:

安装C/C++

导入代码
ubuntu中设置共享文件夹

windows中能直接通过网络访问ubuntu中的文件夹

添加驱动网络映射器

按照IDE的指导导入ubuntu共享的文件夹到vscode

————————————————
版权声明:本文为CSDN博主「wirner」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wirner/article/details/108534406

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包 点赞 收藏 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
电子狂热者
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区