【开发板漂流计划】笨笨的鸿蒙学习笔记(3) 原创

笨笨2020
发布于 2021-10-6 08:31
浏览
0收藏

HiSpark IPC DIY开发套件搭建开发编译环境

  前面烧录了润和提供的uvc模式的bin文件,虽然可以作为USB摄像头来使用,但是没有了WIFI配网功能,感觉少了一种乐趣。于是就想着恢复带WIFI功能的IPC模式,网上百度了一圈,没有找到相应的文件。看来只能自己搭建开发编译环境,编写代码实现了。经过一番摸索实践,终于搭建成功了,下面我就给大家分享一下我的搭建过程。
  由于Windows下还不能完全支持Hi3518板子的开发编译和烧录过程,所以需要安装linux的编译环境用来编译源文件。就我而言,因为自己的笔记本上安装了Docker,所以就选择用Docker来安装环境。
通过OpenHarmony Gitee官方文档可知,目前有三种Docker安装版本。

【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

  一开始,我选择了最新的版本0.0.5版,然后用hpm命令来安装编译ip_camera_hi3518ev300时发生错误。

root@d421505725fe:/home/openharmony/hi3518# hpm dist
[WARN] -  The license of @ohos/openssl is OpenSSL, Original SSLeay. Notice open-source risks.
[WARN] -  The license of @ohos/zlib is zlib/libpng License. Notice open-source risks.
[WARN] -  The license of @ohos/libpng is libpng license. Notice open-source risks.
[WARN] -  The license of @ohos/libjpeg is Libjpeg (JPEG). Notice open-source risks.
[WARN] -  The license of @ohos/linux_kernel is GPL V2.0. Notice open-source risks.
[WARN] -  The license of @ohos/mtd_utils is GPL V2.0. Notice open-source risks.
[WARN] -  The license of @ohos/ltp is GPL V2.0. Notice open-source risks.
[WARN] -  The license of @ohos/gn is gn LICENSE. Notice open-source risks.
[WARN] -  The license of @ohos/llvm is llvm NOTICE. Notice open-source risks.
[WARN] -  The license of @ohos/ip_camera_hi3518ev300 is NA. Notice open-source risks.
Building distribution: @ohos/ip_camera_hi3518ev300
/home/openharmony/hi3518/build/lite/platform/hi3518ev300_liteos_a/platform.json
/home/openharmony/hi3518/subsystems_product.json
[
  '+--dist@1.0.0',
  '│ +--@ohos/ip_camera_hi3518ev300@1.0.3',
  '│ │ +--@ohos/hilog_a@1.0.0',
  '│ │ +--@ohos/app_verify@1.0.0',
  '│ │ +--@ohos/hichainsdk@1.0.0',
  '│ │ +--@ohos/huks@1.0.0',
  '│ │ +--@ohos/iam@1.0.1',
  '│ │ +--@ohos/syspara@1.0.0',
  '│ │ +--@ohos/appspawn@1.0.0',
  '│ │ +--@ohos/init@1.0.0',
  '│ │ +--@ohos/ability@1.0.0',
  '│ │ +--@ohos/bundle_mgr@1.0.0',
  '│ │ +--@ohos/ipc@1.0.0',
  '│ │ +--@ohos/soft_bus@1.0.0',
  '│ │ +--@ohos/system_ability_manager@1.0.0',
  '│ │ +--@ohos/foundation@1.0.0',
  '│ │ +--@ohos/camera@1.0.0',
  '│ │ +--@ohos/audio_manager@1.0.0',
  '│ │ +--@ohos/player@1.0.0',
  '│ │ +--@ohos/recorder@1.0.0',
  '│ │ +--@ohos/media_service@1.0.0',
  '│ │ +--@ohos/graphic@1.0.0',
  '│ │ +--@ohos/hdf@1.0.0',
  '│ │ +--@ohos/utils@1.0.0',
  '│ │ +--@ohos/liteos_a@1.0.0',
  '│ │ +--@ohos/developer_test@1.0.0',
  '│ │ +--@ohos/xts@1.0.0',
  '│ │ +--@ohos/hi3518ev300@1.0.0',
  '│ │ +--@ohos/hi3518ev300_adapter@1.0.0',
  '│ │ +--@ohos/hi3518ev300_uboot@1.0.0',
  '│ │ +--@ohos/camera_sample_app@1.0.0',
  '│ │ +--@ohos/oem_smartvision@1.0.0',
  '│ │ +--@ohos/wpa_supplicant@1.0.0',
  '│ │ +--@ohos/bounds_checking_function@1.0.0',
  '│ │ +--@ohos/cjson@1.0.0',
  '│ │ +--@ohos/mbedtls@1.0.0',
  '│ │ +--@ohos/iniparser@1.0.0',
  '│ │ +--@ohos/global_resource_manager@1.0.0',
  '│ │ +--@ohos/openssl@1.0.0',
  '│ │ +--@ohos/zlib@1.0.0',
  '│ │ +--@ohos/libpng@1.0.0',
  '│ │ +--@ohos/freetype@1.0.0',
  '│ │ +--@ohos/libjpeg@1.0.0',
  '│ │ +--@ohos/googletest@1.0.0',
  '│ │ +--@ohos/nuttx@1.0.0',
  '│ │ +--@ohos/lwip@1.0.0',
  '│ │ +--@ohos/linux_kernel@1.0.0',
  '│ │ +--@ohos/mtd_utils@1.0.0',
  '│ │ +--@ohos/ltp@1.0.0',
  '│ │ +--@ohos/rt_thread@1.0.0',
  '│ │ +--@ohos/fatfs@1.0.0',
  '│ │ +--@ohos/jerryscript@1.0.0',
  '│ │ +--@ohos/musl@1.0.0',
  '│ │ +--@ohos/freebsd@1.0.0',
  '│ │ +--@ohos/distributed_scheduler@1.0.0',
  '│ │ +--@ohos/gn@1.0.0',
  '│ │ +--@ohos/ninja@1.0.0',
  '│ │ +--@ohos/llvm@1.0.0',
  '│ │ +--@ohos/sysroot@1.0.0',
  '│ │ +--@ohos/hc_gen@1.0.0',
  '│ │ +--@ohos/build@1.0.1',
  '│ │ +--@ohos/token@1.0.0',
  '',
  ''
]
[
  'ip_camera_hi3518ev300',
  'hilog_a',
  'app_verify',
  'hichainsdk',
  'huks',
  'iam',
  'syspara',
  'appspawn',
  'init',
  'ability',
  'bundle_mgr',
  'ipc',
  'soft_bus',
  'system_ability_manager',
  'foundation',
  'camera',
  'audio_manager',
  'player',
  'recorder',
  'media_service',
  'graphic',
  'hdf',
  'utils',
  'liteos_a',
  'developer_test',
  'xts',
  'hi3518ev300',
  'hi3518ev300_adapter',
  'hi3518ev300_uboot',
  'camera_sample_app',
  'oem_smartvision',
  'wpa_supplicant',
  'bounds_checking_function',
  'cjson',
  'mbedtls',
  'iniparser',
  'global_resource_manager',
  'openssl',
  'zlib',
  'libpng',
  'freetype',
  'libjpeg',
  'googletest',
  'nuttx',
  'lwip',
  'linux_kernel',
  'mtd_utils',
  'ltp',
  'rt_thread',
  'fatfs',
  'jerryscript',
  'musl',
  'freebsd',
  'distributed_scheduler',
  'gn',
  'ninja',
  'llvm',
  'sysroot',
  'hc_gen',
  'build',
  'token'
]
/home/openharmony/hi3518
comple json generated at /home/openharmony/hi3518/build/lite/product/ipcamera_hi3518.json, start compile

=== start build ===

Done. Made 155 targets from 104 files in 1939ms
ninja: Entering directory `/home/openharmony/hi3518/out/ipcamera_hi3518'
[1/844] STAMP obj/applications/sample/camera/communication/sample.stamp
[2/844] COPY ../../applications/sample/camera/media/cameradev_jxf23.ini data/cameradev.ini
[3/844] STAMP obj/applications/sample/camera/media/camera_config.stamp
[4/844] clang obj/applications/sample/camera/app/src/los_sample.o
[5/844] clang obj/applications/sample/camera/app/src/helloworld.o
[6/844] AR libs/libhello_world.a
[7/844] STAMP obj/applications/sample/camera/app/app_sample.stamp
[8/844] LLVM LINK ./bin/camera_app
FAILED: bin/camera_app
/home/tools/llvm/bin/../bin/clang -lc --target=arm-liteos --sysroot=/home/openharmony/hi3518/prebuilts/lite/sysroot -L/home/tools/llvm/bin/../lib/arm-liteos/c++ -L/home/openharmony/hi3518/prebuilts/lite/sysroot/usr/lib/arm-liteos -L/home/tools/llvm/bin/../lib/clang/9.0.0/lib/arm-liteos -L/home/tools/llvm/bin/../lib/arm-liteos/c++ -lclang_rt.builtins -lc++ -lc++abi -march=armv7-a -mfloat-abi=softfp -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -L/home/openharmony/hi3518/out/ipcamera_hi3518 -Wl,-rpath-link=/home/openharmony/hi3518/out/ipcamera_hi3518 -pie libs/libhello_world.a   -o ./bin/camera_app && /home/tools/llvm/bin/../bin/llvm-objcopy  --strip-all ./bin/camera_app
ld.lld: error: unable to find library -lclang_rt.builtins
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
[9/844] clang obj/base/global/frameworks/resmgr_lite/src/global.o
[10/844] clang obj/base/global/frameworks/resmgr_lite/src/global_utils.o
ninja: build stopped: subcommand failed.
ninja: warning: multiple rules generate obj/base/hiviewdfx/frameworks/hilog_lite/featured/hiview_log.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/base/hiviewdfx/frameworks/hilog_lite/featured/hilog.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/foundation/appexecfwk/services/bundlemgr_lite/src/extractor_util.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/foundation/appexecfwk/services/bundlemgr_lite/src/zip_file.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/foundation/graphic/lite/utils/src/geometry2d.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vsscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wcsncpy_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wmemmove_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/swscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vsnprintf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/swprintf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/fwscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/secureinput_a.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/sprintf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vfscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/snprintf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wcstok_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/secureprintoutput_w.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vfwscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vwscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/memmove_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/strcpy_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wmemcpy_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/fscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/strcat_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/memcpy_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/scanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/securecutil.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wcsncat_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vswscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/strncpy_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/gets_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wcscpy_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vswprintf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/strncat_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/strtok_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/secureinput_w.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wcscat_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/secureprintoutput_a.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/wscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/memset_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/sscanf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/bounds_checking_function/src/vsprintf_s.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/cJSON/cJSON.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/cJSON/cJSON_Utils.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/aes.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/aesni.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/arc4.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/aria.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/asn1parse.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/asn1write.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/base64.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/bignum.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/blowfish.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/camellia.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ccm.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/chacha20.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/chachapoly.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/cipher.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/cipher_wrap.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/cmac.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ctr_drbg.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/des.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/dhm.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ecdh.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ecdsa.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ecjpake.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ecp.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ecp_curves.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/entropy.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/entropy_poll.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/error.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/gcm.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/havege.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/hkdf.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/hmac_drbg.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/md.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/md_wrap.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/md2.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/md4.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/md5.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/memory_buffer_alloc.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/nist_kw.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/oid.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/padlock.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/pem.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/pk.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/pk_wrap.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/pkcs12.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/pkcs5.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/pkparse.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/pkwrite.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/platform.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/platform_util.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/poly1305.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/ripemd160.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/rsa.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/rsa_internal.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/sha1.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/sha256.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/sha512.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/threading.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/timing.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/version.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/version_features.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/x509.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/x509_crt.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/x509_crl.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/mbedtls/library/xtea.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/openssl/crypto/cryptlib.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/openssl/crypto/ec/curve25519.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/openssl/crypto/mem_clr.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/openssl/crypto/sha/sha512.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/adler32.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/compress.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/crc32.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/deflate.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/gzclose.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/gzlib.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/gzread.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/gzwrite.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/infback.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/inffast.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/inflate.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/inftrees.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/trees.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/uncompr.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/zutil.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/contrib/minizip/ioapi.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/contrib/minizip/unzip.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate obj/third_party/zlib/contrib/minizip/zip.o. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
you can check build log in /home/openharmony/hi3518/out/ipcamera_hi3518/build.log
/home/tools/ninja/ninja -w dupbuild=warn -C /home/openharmony/hi3518/out/ipcamera_hi3518 failed, return code is 1
usage:
  python build.py ipcamera_hi3516dv300
  python build.py ipcamera_hi3518ev300
  python build.py wifiiot

positional arguments:
  product               Name of the product

optional arguments:
  -h, --help            show this help message and exit
  -b BUILD_TYPE, --build_type BUILD_TYPE
                        release or debug version.
  -t [TEST [TEST ...]], --test [TEST [TEST ...]]
                        Compile test suit
  -n, --ndk             Compile ndk
root@d421505725fe:/home/openharmony/hi3518#

  经过确认,@ohos/ip_camera_hi3518ev300对应的是openharmony 1.0的版本代码,0.0.5版本docker镜像对应的是最新的master代码。所以如果要编译成功请使用swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3。好吧,那我们使用0.0.3版本。

0.0.3版Docker环境安装

docker run -it -p 6222:22 --name ubuntu-ohos -v D:\work\docker\hispark_ohos:/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3

hmp命令安装(失败告终)

hpm init -t dist
hpm i @ohos/ip_camera_hi3518ev300

【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

1.0源码下载编译(成功)

源码下载

1.0版源码

源码编译

tar -zxvf code-1.0.tar.gz -C ./ohos_1.0
cd ohos_1.0
python build.py ipcamera_hi3518ev300

【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区
【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

结果烧录

1.如下图所示,从out/ipcamera_hi3518ev300目录下把OHOS_Image.bin, rootfs.img, userfs.img三个文件拷贝到新目录待用

【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

2.同样,从vendor\hisi\hi35xx\hi3518ev300\uboot\out\boot目录,把u-boot-hi3518ev300.bin拷贝到新目录待用(此处我用的是D:\work\docker\hispark_ohos\ohos_1.0\dist)
【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

3.编写hi3518.xml进行配置,并同样保存至新目录待用
注意,Length需要和实际文件大小相匹配,向上取整,比如5.2M就取6M

<?xml version="1.0" encoding="GB2312" ?>
<Partition_Info>
<Part Sel="1" PartitionName="fastboot" FlashType="spi" FileSystem="none" Start="0" Length="1M" SelectFile="D:\work\docker\hispark_ohos\ohos_1.0\dist\u-boot-hi3518ev300.bin"/>
<Part Sel="1" PartitionName="" FlashType="spi" FileSystem="none" Start="1M" Length="6M" SelectFile="D:\work\docker\hispark_ohos\ohos_1.0\dist\OHOS_Image.bin"/>
<Part Sel="1" PartitionName="" FlashType="spi" FileSystem="none" Start="7M" Length="8M" SelectFile="D:\work\docker\hispark_ohos\ohos_1.0\dist\rootfs.img"/>
<Part Sel="1" PartitionName="" FlashType="spi" FileSystem="none" Start="15M" Length="1M" SelectFile="D:\work\docker\hispark_ohos\ohos_1.0\dist\userfs.img"/>
</Partition_Info>


4.使用HiTool烧录
【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区
【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区
【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

5.设置环境变量并重启

setenv bootcmd “sf probe 0;sf read 0x40000000 0x100000 0x600000;go 0x40000000”;
setenv bootargs “console=ttyAMA0,115200n8 root=flash fstype=jffs2 rw rootaddr=7M rootsize=8M”;
saveenv
reset

【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区
【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

6.执行sample程序(bin/camear_app)
【开发板漂流计划】笨笨的鸿蒙学习笔记(3)-鸿蒙开发者社区

当Hello OHOS!显示出来,就代表你已经可以自己编写代码,做自己想做的事情了。不过这个1.0的代码,总觉得是有点落后,毕竟3.0的版本已经出来了。不管怎样,环境这块算是搞定。

©著作权归作者所有,如需转载,请注明出处,否则将追究法律责任
已于2021-10-6 08:47:44修改
1
收藏
回复
举报
回复
    相关推荐