diff --git a/docs/hi3516_dv300_helloworld/README.md b/docs/hi3516_dv300_helloworld/README.md deleted file mode 100644 index 7e844be7b3d0053e8fcbb2100e877445b289fe57..0000000000000000000000000000000000000000 --- a/docs/hi3516_dv300_helloworld/README.md +++ /dev/null @@ -1,255 +0,0 @@ -# Hi3516DV300开发板标准设备上手-HelloWorld - - -## 1、简介 - -本节指导开发者在Hi3516DV300开发板上运行第一个应用程序,其中包括新建应用程序、编译、烧写、运行等步骤,最终输出“Hello World!” - -#### 1.1.HelloWorld 运行效果 - - ![0](./resource/0.png) - - -#### 1.2.支持OpenHarmony版本 - -OpenHarmony 3.0 LTS、OpenHarmony 3.1 Beta。 - - -#### 1.3.开发板介绍 - -Hi3516DV300是新一代行业专用Smart HD IP摄像机SOC,集成新一代ISP(Image Signal Processor)、H.265视频压缩编码器、高性能NNIE引擎,在低码率、高画质、智能处理和分析、低功耗等方面引领行业水平。 - -开发板实物图如下: - - ![1](./resource/1.jpg) - -## 2、 环境搭建 - -这里在Ubuntu 20.04版本以Docker环境为例 - -#### 2.1获取Docker环境 - -``` -#安装Docker -cd ~ -curl -fsSL https://get.docker.com -o get-docker.sh -chmod a+x get-docker.sh -sudo ./get-docker.sh - -#获取Docker镜像 -sudo docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.5 - -#进入源码根目录执行如下命令,从而进入Docker构建环境 -sudo docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.5 -``` - - -## 3、 获取源码 - -#### 3.1.配置git和安装repo - -参考[官网文章](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/zh-cn/device-dev/quick-start/quickstart-standard-docker-environment.md) 步骤学习 - -``` -#安装Ubuntu 20.04 - -# 安装repo -curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 | sudo tee /usr/local/bin/repo >/dev/null -sudo chmod a+x /usr/local/bin/repo - -# 设置git信息 -git config --global user.name "yourname" -git config --global user.email "your-email-address" -git config --global credential.helper store - -#安装git-lfs -sudo apt-get install git-lfs -``` - -#### 3.2.拉取源码 - -``` -cd ~ -mkdir openharmony -cd openharmony -repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1-Beta --no-repo-verify -repo sync -c -repo forall -c 'git lfs pull' -``` -#### 3.3.执行预编译脚本 - -``` -#在源码根目录下执行脚本,安装编译器及二进制工具 -#下载的prebuilts二进制默认存放在与OpenHarmony同目录下的OpenHarmony_2.0_canary_prebuilts下 -./build/prebuilts_download.sh -``` - -## 4、编写自己的hello world - -#### 4.1 新建目录及源码。 - -在源码根目录下创建hello/helloworld/src/helloworld.c目录及文件,代码如下所示,用户可以自定义修改打印内容(例如:修改World为OHOS)。其中helloworld.h包含字符串打印函数HelloPrint的声明。当前应用程序可支持标准C及C++的代码开发。 - -``` -#include -#include "helloworld.h" - -int main(int argc, char **argv) -{ - HelloPrint(); - return 0; -} - -void HelloPrint() -{ - printf("\n************************************************\n"); - printf("\n\t\tHello World!\n"); - printf("\n************************************************\n"); -} -``` - -再添加头文件hello/helloworld/include/helloworld.h,代码如下所示。 - -``` -#ifndef HELLOWORLD_H -#define HELLOWORLD_H -#ifdef __cplusplus -#endif - -void HelloPrint(); - - -#endif -#endif // HELLOWORLD_H -``` - -#### 4.2 新建编译组织文件。 - -###### 4.2.1 新建编译组织文件。新建hello/helloworld/BUILD.gn文件,内容如下所示: -``` -import("//build/ohos.gni") -ohos_executable("helloworld") { - sources = [ - "src/helloworld.c" - ] - include_dirs = [ - "include" - ] - part_name = "hello_exe" - install_enable = true -} - - -``` - -###### 4.2.2 新建hello/ohos.build文件,添加hello部件描述,内容如下所示。 - -``` -{ - "subsystem": "hello", - "parts": { - "hello_exe": { - "module_list": [ - "//hello/helloworld:helloworld" - ] - } - } -} - - -``` - - -#### 4.3 修改产品配置文件。 - -在productdefine\common\products\rk3568.json中添加对应的hello部件,直接添加到原有部件后即可。 - -``` - "usb:usb_manager_native":{}, - "applications:prebuilt_hap":{}, - "wpa_supplicant-2.9:wpa_supplicant-2.9":{}, - "hello:hello_exe":{} -``` - -## 5、 源码编译 - -``` -#进入源码根目录,执行如下命令进行版本编译 -./build.sh --product-name Hi3516DV300 --ccache - -#编译完成后会有如下显示 -=====build Hi3516DV300 successful. - -``` - -生成固件路径 out/hi3516dv300/packages/phone/images - - -## 6、镜像烧录 -USB烧录 - -#### 6.1、请连接好电脑和待烧录开发板,需要同时连接串口和USB口,具体可参考[Hi3516DV300开发板介绍](https://gitee.com/openharmony/docs/blob/OpenHarmony_1.0.1_release/zh-cn/device-dev/quick-start/Hi3516%E5%BC%80%E5%8F%91%E6%9D%BF%E4%BB%8B%E7%BB%8D.md) - - - ![3](./resource/3.png) - - -#### 6.2、打开电脑的设备管理器,查看并记录对应的串口号。 -如果对应的串口异常,请根据[Hi3516DV300/Hi3518EV300开发板串口驱动安装指导](https://device.harmonyos.com/cn/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695) 安装USB转串口的驱动程序。 - - ![4](./resource/4.png) - -#### 6.3、安装USB驱动 - -下载USB驱动,[下载地址](http://www.hihope.org/download/download.aspx?mtt=11) - - - ![2](./resource/2.png) - -如果安装驱动后,还提示不识别的USB设备,请将下面的内容保存未一个注册表文件,如test.reg,然后注册。 - - -Windows Registry Editor Version 5.00 - -``` -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\12D1D0010100] -"SkipBOSDescriptorQuery"=hex:01,00,00,00 -"osvc"=hex:00,00 -"IgnoreHWSerNum"=hex:01 -``` - -#### 6.4、使用Hitools,烧写,然后按住串口边上的复位键,插拔USB电源线重启 - - ![5](./resource/5.jpg) - - -#### 6.5、烧写成功 - - ![6](./resource/6.png) - - -## 7、镜像运行 - - -#### 7.1 相关配置 -第一次烧录3.1镜像后,启动时需要设置,参考官网中给的命令设置(仅第一次烧录时需要)。使用方式:在终端1窗口设置正确端口号,如COM3,点击连接。重启开发板电源时,迅速按回车,输入如下命令 - -重启电源后,及时按回车 进入命令模式 - ![24](./resource/24.jpg) - -``` -setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)'; - -setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000' - -save - -reset - -``` - -#### 7.2 运行helloworld - -打开串口后,在任意目录(以设备根目录为例)下输入命令helloworld后回车,即出现“Hello World!”字样。 - - ![0](./resource/0.png) diff --git a/docs/hi3516_dv300_helloworld/resource/0.png b/docs/hi3516_dv300_helloworld/resource/0.png deleted file mode 100644 index da22f3989b1daa362c7471789cdaa94ffb862f75..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/0.png and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/1.jpg b/docs/hi3516_dv300_helloworld/resource/1.jpg deleted file mode 100644 index 5c7166b1c531f6ae15c79c82c03c8fa3342932e7..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/1.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/13.jpg b/docs/hi3516_dv300_helloworld/resource/13.jpg deleted file mode 100644 index 8a7c86796acc1d888183bca4429e232c706517a3..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/13.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/13_1.jpg b/docs/hi3516_dv300_helloworld/resource/13_1.jpg deleted file mode 100644 index 240e1ce2ccbd6a92518c8210a52e3a1312fcf6c7..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/13_1.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/14.jpg b/docs/hi3516_dv300_helloworld/resource/14.jpg deleted file mode 100644 index 404f5e953c76ff04791b8c2913a5d16ee635704a..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/14.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/15.jpg b/docs/hi3516_dv300_helloworld/resource/15.jpg deleted file mode 100644 index 2ae8f0d362ad8f39eb17ac551dfaede22dff52be..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/15.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/16.jpg b/docs/hi3516_dv300_helloworld/resource/16.jpg deleted file mode 100644 index 4204edc212437e9ac88eca2b6c942374febf51d3..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/16.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/17.jpg b/docs/hi3516_dv300_helloworld/resource/17.jpg deleted file mode 100644 index 430e5c8887512ba5061cbd9941b190693f83340f..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/17.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/18.jpg b/docs/hi3516_dv300_helloworld/resource/18.jpg deleted file mode 100644 index e10be6775465897ee4bb63e905e445f8a4848d9c..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/18.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/19.jpg b/docs/hi3516_dv300_helloworld/resource/19.jpg deleted file mode 100644 index 77a6f756ee92e6bcaf8c6053bee1d5de6ec1117f..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/19.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/20.jpg b/docs/hi3516_dv300_helloworld/resource/20.jpg deleted file mode 100644 index 3b84e65b72a85deb4c5d5e379fbf111cdd18bb76..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/20.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/21.jpg b/docs/hi3516_dv300_helloworld/resource/21.jpg deleted file mode 100644 index fad4e9aa7d07a455b0beed5ab21e9b2d2b33a319..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/21.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/22.jpg b/docs/hi3516_dv300_helloworld/resource/22.jpg deleted file mode 100644 index 6bfcb0a14bd21752847c02224e5f396073754380..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/22.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/23.png b/docs/hi3516_dv300_helloworld/resource/23.png deleted file mode 100644 index ba191980427b4e95b42014792ba1b9057631294b..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/23.png and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/24.jpg b/docs/hi3516_dv300_helloworld/resource/24.jpg deleted file mode 100644 index 2a6fe9ede45f2e7404a22d8754a77ed7bc8f748e..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/24.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/24.png b/docs/hi3516_dv300_helloworld/resource/24.png deleted file mode 100644 index bc063545c058305ca90b1ee64b82617f3861242a..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/24.png and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/25.jpg b/docs/hi3516_dv300_helloworld/resource/25.jpg deleted file mode 100644 index 1bd593f47105585317a71f2b1ecd77edde2b40e5..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/25.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/26.png b/docs/hi3516_dv300_helloworld/resource/26.png deleted file mode 100644 index 105e9a83292ff333cafb813ecd6647dd256a9443..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/26.png and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/3.png b/docs/hi3516_dv300_helloworld/resource/3.png deleted file mode 100644 index 172b131212369efe4c771e988686633cd5af52b1..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/3.png and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/4.png b/docs/hi3516_dv300_helloworld/resource/4.png deleted file mode 100644 index 0fe8de2e0715021201843e7da45309dfd9ba4e65..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/4.png and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/5.jpg b/docs/hi3516_dv300_helloworld/resource/5.jpg deleted file mode 100644 index 6eb25759d9b9fe164912393bdb3662c531330181..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/5.jpg and /dev/null differ diff --git a/docs/hi3516_dv300_helloworld/resource/6.png b/docs/hi3516_dv300_helloworld/resource/6.png deleted file mode 100644 index f2dbf7fac9334f59ab8be9dee9d440a589ecb0ce..0000000000000000000000000000000000000000 Binary files a/docs/hi3516_dv300_helloworld/resource/6.png and /dev/null differ diff --git a/docs/hi3516_dv300_small_helloworld/README.md b/docs/hi3516_dv300_small_helloworld/README.md new file mode 100644 index 0000000000000000000000000000000000000000..239ba79ef71dc3f5bcc915871ce16100d97a9052 --- /dev/null +++ b/docs/hi3516_dv300_small_helloworld/README.md @@ -0,0 +1,393 @@ +## Hi3516DV300开发板小型设备-HelloWorld + +## 1、简介 + +本样例基于Hi3516开发板,通过串口打印Hello World,旨在告诉开发者如何新建Hello World项目。 + +##### 1.1HelloWorld运行效果 + +![image-20220128170610357](figures/image-20220128170610357.png) + +##### 1.2支持OpenHarmony版本 + +OpenHarmony 3.0 LTS。 + +##### 1.3开发板介绍 + +![img](https://gitee.com/openharmony/docs/raw/master/zh-cn/device-dev/quick-start/figures/3516%E6%AD%A3%E9%9D%A2.png) + +## 2、环境搭建 + +预装Ubuntu20.04环境,这里以Docker方式进行环境搭建。 + +#### 2.1安装Docker + +这里只介绍Docker安装步骤,其他详细信息参考[官方指导](https://docs.docker.com/engine/install/ubuntu/)。 + +- 设置存储库。 + +``` +sudo apt-get update +sudo apt-get install \ + ca-certificates \ + curl \ + gnupg \ + lsb-release +``` + +- 添加Docker的官方GPG密钥。 + +``` +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +``` + +- 使用以下命令设置**stable**存储库。 + +``` +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +``` + +- 安装Docker Engine。 + +``` +sudo apt-get update +sudo apt-get install docker-ce docker-ce-cli containerd.io +``` + +- 安装最新版本的Docker CE。 + +``` +apt-cache madison docker-ce +``` + +- 运行hello-world镜像,显示如下说明安装成功。 + +``` +sudo docker run hello-world +``` + +![image-20220211104009136](figures/image-20220211104009136.png) + +#### 2.2获取docker环境 + +**说明:** 不同的源码版本要匹配使用对应版本的Docker环境,本文以Master主干代码为例进行说明。 + +OpenHarmony的Docker镜像托管在[HuaweiCloud SWR](https://gitee.com/link?target=https%3A%2F%2Fconsole.huaweicloud.com%2Fswr%2F%3Fregion%3Dcn-south-1%23%2Fapp%2Fwarehouse%2FwarehouseMangeDetail%2Fgoldensir%2Fopenharmony-docker%2Fopenharmony-docker%3Ftype%3DownImage)上。开发者可以通过该镜像在很大程度上简化编译前的环境配置。下文将介绍具体使用步骤。 + +- 获取Docker镜像。 + +``` +sudo docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5 +``` + +## 3、获取源码 + +#### 3.1配置git和安装repo + +- 安装repo + +``` +curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo +chmod a+x /usr/local/bin/repo +``` + +- 设置git信息 + +``` +git config --global user.name "yourname" +git config --global user.email "your-email-address" +git config --global credential.helper store +``` + +- 安装git-lfs + +``` +sudo apt-get install git-lfs +``` + +#### 3.2拉取源码 + +``` +repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v3.0-LTS --no-repo-verify +repo sync -c +repo forall -c 'git lfs pull' +``` + +## 4、编写自己的hello world + +#### 4.1新建目录及源码 + +新建**applications/sample/camera/apps/src/helloworld.c**目录及文件,代码如下所示,用户可以自定义修改打印内容(例如:修改World为OpenHarmony)。当前应用程序可支持标准C及C++的代码开发。 + +``` +#include + +int main(int argc, char **argv) +{ + printf("\n************************************************\n"); + printf("\n\t\tHello World!\n"); + printf("\n************************************************\n\n"); + + return 0; +} +``` + +#### 4.2新建编译组织文件 + +新建**applications/sample/camera/apps/BUILD.gn**文件,内容如下所示: + +``` +import("//build/lite/config/component/lite_component.gni") +lite_component("hello-OHOS") { + features = [ ":helloworld" ] +} +executable("helloworld") { + output_name = "helloworld" + sources = [ "src/helloworld.c" ] + include_dirs = [] + defines = [] + cflags_c = [] + ldflags = [] +} +``` + +#### 4.3添加新组件。 + +修改文件**build/lite/components/applications.json**,添加组件hello_world_app的配置,如下所示为applications.json文件片段,"##start##"和"##end##"之间为新增配置**("##start##"和"##end##"仅用来标识位置,添加完配置后删除这两行)**: + +``` +{ + "components": [ + { + "component": "camera_sample_communication", + "description": "Communication related samples.", + "optional": "true", + "dirs": [ + "applications/sample/camera/communication" + ], + "targets": [ + "//applications/sample/camera/communication:sample" + ], + "rom": "", + "ram": "", + "output": [], + "adapted_kernel": [ "liteos_a" ], + "features": [], + "deps": { + "components": [], + "third_party": [] + } + }, +##start## + { + "component": "hello_world_app", + "description": "Communication related samples.", + "optional": "true", + "dirs": [ + "applications/sample/camera/apps" + ], + "targets": [ + "//applications/sample/camera/apps:hello-OHOS" + ], + "rom": "", + "ram": "", + "output": [], + "adapted_kernel": [ "liteos_a" ], + "features": [], + "deps": { + "components": [], + "third_party": [] + } + }, +##end## + { + "component": "camera_sample_app", + "description": "Camera related samples.", + "optional": "true", + "dirs": [ + "applications/sample/camera/launcher", + "applications/sample/camera/cameraApp", + "applications/sample/camera/setting", + "applications/sample/camera/gallery", + "applications/sample/camera/media" + ], +``` + +#### 4.4修改单板配置文件。 + +修改文件**vendor/hisilicon/hispark_taurus/config.json**,新增hello_world_app组件的条目,如下所示代码片段为applications子系统配置,"##start##"和"##end##"之间为新增条目**("##start##"和"##end##"仅用来标识位置,添加完配置后删除这两行):** + +``` + { + "subsystem": "applications", + "components": [ + { "component": "camera_sample_app", "features":[] }, + { "component": "camera_sample_ai", "features":[] }, +##start## + { "component": "hello_world_app", "features":[] }, +##end## + { "component": "camera_screensaver_app", "features":[] } + ] + }, +``` + +## 5、源码编译 + +#### 5.1设置编译对象 + +- 在源码根目录下执行以下命令进入Docker环境(exit命令退出Docker环境)。 + +``` +sudo docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5 +``` + +- 执行如下命令设置编译路径,“./"(选择当前路径),选择ipcamera_hispark_taurus。 + +``` +hb set +``` + +![image-20220214190912654](figures/image-20220214190912654.png) + +#### 5.2开始编译 + +执行如下命令进行全量编译(hb build增量编译)。 + +``` +hb build -f +``` + +![image-20220214191059215](figures/image-20220214191059215.png) + +显示ipcamera_hispark_taurus build success表示编译成功。 + +![image-20220214191130266](figures/image-20220214191130266.png) + +编译完成后生成以下文件: + +OHOS_Image.bin、rootfs_jffs2.img、u-boot-hi3518ev300.bin、userfs_jffs2.img + +![image-20220214190950820](figures/image-20220214190950820.png) + +## 6、镜像烧录 + +#### 6.1驱动安装 + +##### 6.1.1设备连接 + +这里选择的是USB方式烧录,需同时连接串口和USB。 + +![image-20220128152950494](figures/image-20220128152950494.png) + +![image-20220128153222752](figures/image-20220128153222752.png) + +##### 6.1.2安装USB驱动 + +- 下载USB驱动,[下载地址](https://gitee.com/link?target=http%3A%2F%2Fwww.hihope.org%2Fdownload%2Fdownload.aspx%3Fmtt%3D11) + + +![image-20220128145433087](figures/image-20220128145433087.png) + +- 如果安装驱动后,还提示无法识别的USB设备,将下面内容填入记事本中,保存为一个注册表文件,如test.reg,然后注册。 + + +``` +Windows Registry Editor Version 5.00。 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\12D1D0010100] +"SkipBOSDescriptorQuery"=hex:01,00,00,00 +"osvc"=hex:00,00 +"IgnoreHWSerNum"=hex:01 +``` + +- 如下图,双击进行注册。 + + +![image-20220207101615876](figures/image-20220207101615876.png) + +##### 6.1.3下载Hitool + +HiTool工具[下载](http://www.hihope.org/download/download.aspx?mtt=33) + +#### 6.2烧录工具配置 + +##### 6.2.1拷出烧录文件 + +编译完成后,将以下文件拷出至windows下。 + +OHOS_Image.bin(./out/hispark_taurus/ipcamera_hispark_taurus/) + +rootfs_jffs2.img(./out/hispark_taurus/ipcamera_hispark_taurus/) + +userfs_jffs2.img(./out/hispark_taurus/ipcamera_hispark_taurus/) + +u-boot-hi3518ev300.bin(./device/hisilicon/hispark_taurus/sdk_liteos/uboot/out/boot/) + +![image-20220128143304950](figures/image-20220128143304950.png) + +![image-20220128143446562](figures/image-20220128143446562.png) + +##### 6.2.2查看串口号 + +打开电脑的设备管理器,查看并记录对应的串口号,如果对应的串口异常,请根据[Hi3516DV300/Hi3518EV300开发板串口驱动安装指导](https://gitee.com/link?target=https%3A%2F%2Fdevice.harmonyos.com%2Fcn%2Fdocs%2Fdocumentation%2Fguide%2Fhi3516_hi3518-drivers-0000001050743695) 安装USB转串口的驱动程序。 + +![image-20220128145330230](figures/image-20220128145330230.png) + +##### 6.2.3使用HiTools烧录,按如下图配置 + +![image-20220208114438466](figures/image-20220208114438466.png) + +##### 6.2.4开始烧写 + +按住复位键,点击烧写,插拔USB线,松开复位键开始烧写。 + +![image-20220214161936337](figures/image-20220214161936337.png) + +##### 6.2.5出现如下表示开始烧写 + +image-20220128153706016 + +#### 6.3烧录完成 + +image-20220128154110331 + +## 7、镜像运行 + +- 打开终端 + +在终端1窗口设置正确端口号,如COM4。 + +![image-20220207103611031](figures/image-20220207103611031.png) + +- 执行命令 + +第一次烧录3.0镜像后,还需要设置BootLoader引导程序,才能运行OpenHarmony系统。重启开发板,迅速按回车,执行如下命令。命令解释请参考官网[命令](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3518-running.md#li9441185382314) 。 + +``` +setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800; go 0x80000000"; + +setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=20M rw"; + +saveenv + +reset +``` + +![image-20220128164723657](figures/image-20220128164723657.png) + +- 进入bin目录 + +![image-20220128164833281](figures/image-20220128164833281.png) + +- 运行helloworld文件 + +执行如下命令运行helloworld文件。 + +``` +./helloworld +``` + +![image-20220128165241532](figures/image-20220128165241532.png) + diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128101139048.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128101139048.png new file mode 100644 index 0000000000000000000000000000000000000000..e23ffeca82d3d690448c82a6cb40463786f80dc2 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128101139048.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128101610450.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128101610450.png new file mode 100644 index 0000000000000000000000000000000000000000..d37e1e6b1ed7eed9d2539469916b08479af13f1e Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128101610450.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128105414727.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128105414727.png new file mode 100644 index 0000000000000000000000000000000000000000..709e8eca37b206e944967ad015c39a61685ade7b Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128105414727.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128143304950.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128143304950.png new file mode 100644 index 0000000000000000000000000000000000000000..49dd4b82b51323aac8918f8fe37d50727309bc66 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128143304950.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128143446562.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128143446562.png new file mode 100644 index 0000000000000000000000000000000000000000..27f38819c498b0bafb9585eef73a9384fc3aef47 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128143446562.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128145330230.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128145330230.png new file mode 100644 index 0000000000000000000000000000000000000000..734ece199d3b290fe6c3c2c1ffa7487cc1be671f Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128145330230.png differ diff --git a/docs/hi3516_dv300_helloworld/resource/2.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128145433087.png similarity index 100% rename from docs/hi3516_dv300_helloworld/resource/2.png rename to docs/hi3516_dv300_small_helloworld/figures/image-20220128145433087.png diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128152211426.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128152211426.png new file mode 100644 index 0000000000000000000000000000000000000000..b8c535541e0cb25145274c297eb089e24849f64e Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128152211426.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128152950494.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128152950494.png new file mode 100644 index 0000000000000000000000000000000000000000..f298929ca10ee3c697a7a0ebc810a964c77597a7 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128152950494.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128153222752.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128153222752.png new file mode 100644 index 0000000000000000000000000000000000000000..e86eaa108f1b0258de653827509dae61dd306c16 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128153222752.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128153706016.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128153706016.png new file mode 100644 index 0000000000000000000000000000000000000000..c3eaaa031ca9d120f068bd87d928de56d92d8eb3 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128153706016.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128154110331.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128154110331.png new file mode 100644 index 0000000000000000000000000000000000000000..3727ceba81da55d71089022ffd812fdf11d2b818 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128154110331.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128164723657.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128164723657.png new file mode 100644 index 0000000000000000000000000000000000000000..93caaa184b2bd73a335324409cbb0f3ee4a5075e Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128164723657.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128164833281.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128164833281.png new file mode 100644 index 0000000000000000000000000000000000000000..eb4c60ffcdc5ff6c1a40174ac6c21032e5df6315 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128164833281.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128165142833.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128165142833.png new file mode 100644 index 0000000000000000000000000000000000000000..474db22a61c92b58146a2eced06709e8c6258271 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128165142833.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128165241532.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128165241532.png new file mode 100644 index 0000000000000000000000000000000000000000..6085b51647cc562a5b5b6611bed2dd7255cae8fb Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128165241532.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220128170610357.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220128170610357.png new file mode 100644 index 0000000000000000000000000000000000000000..185002241920ccf3aebb165502f2312e84b9d3ba Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220128170610357.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220207101615876.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220207101615876.png new file mode 100644 index 0000000000000000000000000000000000000000..b81b51ec399cfcab21ec85d8cd2b1732e6237573 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220207101615876.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220207103611031.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220207103611031.png new file mode 100644 index 0000000000000000000000000000000000000000..e98f4fd42f7d1b6fb1069fa9fca33b86f5e10735 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220207103611031.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220208114438466.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220208114438466.png new file mode 100644 index 0000000000000000000000000000000000000000..a139034aac61e5a932fa9d4d8849cf8817eedf2b Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220208114438466.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220211104009136.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220211104009136.png new file mode 100644 index 0000000000000000000000000000000000000000..cdb625e6a6bffbbe4b9cc9d0fd20533554522b3b Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220211104009136.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220211105407300.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220211105407300.png new file mode 100644 index 0000000000000000000000000000000000000000..13e7e81b9841055b4b8312e801ae5585f0905e69 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220211105407300.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220211105509876.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220211105509876.png new file mode 100644 index 0000000000000000000000000000000000000000..918c88711fcf5aff1a1ece93649020c068bbe381 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220211105509876.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220211105702379.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220211105702379.png new file mode 100644 index 0000000000000000000000000000000000000000..0f2cd92196ba0015ae70b9720d862fafa3a4e739 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220211105702379.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220214161936337.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220214161936337.png new file mode 100644 index 0000000000000000000000000000000000000000..02e33081f12a427ab3c5bc04a827e2dbfb71984a Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220214161936337.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220214190912654.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220214190912654.png new file mode 100644 index 0000000000000000000000000000000000000000..918c88711fcf5aff1a1ece93649020c068bbe381 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220214190912654.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220214190950820.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220214190950820.png new file mode 100644 index 0000000000000000000000000000000000000000..49dd4b82b51323aac8918f8fe37d50727309bc66 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220214190950820.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220214191007580.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191007580.png new file mode 100644 index 0000000000000000000000000000000000000000..d37e1e6b1ed7eed9d2539469916b08479af13f1e Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191007580.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220214191046974.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191046974.png new file mode 100644 index 0000000000000000000000000000000000000000..0f2cd92196ba0015ae70b9720d862fafa3a4e739 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191046974.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220214191059215.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191059215.png new file mode 100644 index 0000000000000000000000000000000000000000..0f2cd92196ba0015ae70b9720d862fafa3a4e739 Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191059215.png differ diff --git a/docs/hi3516_dv300_small_helloworld/figures/image-20220214191130266.png b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191130266.png new file mode 100644 index 0000000000000000000000000000000000000000..709e8eca37b206e944967ad015c39a61685ade7b Binary files /dev/null and b/docs/hi3516_dv300_small_helloworld/figures/image-20220214191130266.png differ diff --git a/docs/hi3518_ev300_small_helloworld/README.md b/docs/hi3518_ev300_small_helloworld/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fb7f5fcf7c0a89baae343f68e29cc602c68e8e1d --- /dev/null +++ b/docs/hi3518_ev300_small_helloworld/README.md @@ -0,0 +1,410 @@ +## Hi3518EV300开发板小型设备-HelloWorld + +## 1、简介 + +本样例基于Hi3518开发板,通过串口打印Hello World,旨在告诉开发者如何新建Hello World项目。 + +#### 1.1HelloWorld运行效果 + +![image-20220214173837395](figures/image-20220214173837395.png) + +#### 1.2支持OpenHarmony版本 + +OpenHarmony 3.0 LTS。 + +#### 1.3开发板介绍 + +背面 + +![img](https://gitee.com/openharmony/docs/raw/master/zh-cn/device-dev/quick-start/figures/Hi3518%E6%AD%A3%E8%83%8C%E9%9D%A2.png) + +正面 + +![img](https://gitee.com/openharmony/docs/raw/master/zh-cn/device-dev/quick-start/figures/Hi3518EV300%E5%8D%95%E6%9D%BF%E6%AD%A3%E9%9D%A2%E5%A4%96%E8%A7%82%E5%9B%BE.png) + +## 2、环境搭建 + +预装Ubuntu20.04环境,这里以Docker方式进行环境搭建。 + +#### 2.1安装Docker + +这里只介绍Docker安装步骤,其他详细信息参考[官方指导](https://docs.docker.com/engine/install/ubuntu/)。 + +- 设置存储库。 + +``` +sudo apt-get update +sudo apt-get install \ + ca-certificates \ + curl \ + gnupg \ + lsb-release +``` + +- 添加Docker的官方GPG密钥。 + +``` +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +``` + +- 使用以下命令设置**stable**存储库。 + +``` +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +``` + +- 安装Docker Engine。 + +``` +sudo apt-get update +sudo apt-get install docker-ce docker-ce-cli containerd.io +``` + +- 安装最新版本的Docker CE。 + +``` +apt-cache madison docker-ce +``` + +- 运行hello-world镜像,显示如下说明安装成功。 + +``` +sudo docker run hello-world +``` + +![image-20220211104009136](figures/image-20220211104009136.png) + +#### 2.2获取docker环境 + +**说明:** 不同的源码版本要匹配使用对应版本的Docker环境,本文以Master主干代码为例进行说明。 + +OpenHarmony的Docker镜像托管在[HuaweiCloud SWR](https://gitee.com/link?target=https%3A%2F%2Fconsole.huaweicloud.com%2Fswr%2F%3Fregion%3Dcn-south-1%23%2Fapp%2Fwarehouse%2FwarehouseMangeDetail%2Fgoldensir%2Fopenharmony-docker%2Fopenharmony-docker%3Ftype%3DownImage)上。开发者可以通过该镜像在很大程度上简化编译前的环境配置。下文将介绍具体使用步骤。 + +- 获取Docker镜像。 + +``` +sudo docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5 +``` + +## 3、获取源码 + +#### 3.1配置git和安装repo + +- 安装repo + +``` +curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo +chmod a+x /usr/local/bin/repo +``` + +- 设置git信息 + +``` +git config --global user.name "yourname" +git config --global user.email "your-email-address" +git config --global credential.helper store +``` + +- 安装git-lfs + +``` +sudo apt-get install git-lfs +``` + +#### 3.2拉取源码 + +``` +repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v3.0-LTS --no-repo-verify +repo sync -c +repo forall -c 'git lfs pull' +``` + +## 4、编写自己的hello world + +#### 4.1新建目录及源码 + +新建**applications/sample/camera/apps/src/helloworld.c**目录及文件,代码如下所示,用户可以自定义修改打印内容(例如:修改World为OpenHarmony)。当前应用程序可支持标准C及C++的代码开发。 + +``` +#include + +int main(int argc, char **argv) +{ + printf("\n************************************************\n"); + printf("\n\t\tHello World!\n"); + printf("\n************************************************\n\n"); + + return 0; +} +``` + +#### 4.2新建编译组织文件 + +新建**applications/sample/camera/apps/BUILD.gn**文件,内容如下所示: + +``` +import("//build/lite/config/component/lite_component.gni") +lite_component("hello-OHOS") { + features = [ ":helloworld" ] +} +executable("helloworld") { + output_name = "helloworld" + sources = [ "src/helloworld.c" ] + include_dirs = [] + defines = [] + cflags_c = [] + ldflags = [] +} +``` + +#### 4.3添加新组件。 + +修改文件**build/lite/components/applications.json**,添加组件hello_world_app的配置,如下所示为applications.json文件片段,"##start##"和"##end##"之间为新增配置**("##start##"和"##end##"仅用来标识位置,添加完配置后删除这两行)**: + +``` +{ + "components": [ + { + "component": "camera_sample_communication", + "description": "Communication related samples.", + "optional": "true", + "dirs": [ + "applications/sample/camera/communication" + ], + "targets": [ + "//applications/sample/camera/communication:sample" + ], + "rom": "", + "ram": "", + "output": [], + "adapted_kernel": [ "liteos_a" ], + "features": [], + "deps": { + "components": [], + "third_party": [] + } + }, +##start## + { + "component": "hello_world_app", + "description": "Communication related samples.", + "optional": "true", + "dirs": [ + "applications/sample/camera/apps" + ], + "targets": [ + "//applications/sample/camera/apps:hello-OHOS" + ], + "rom": "", + "ram": "", + "output": [], + "adapted_kernel": [ "liteos_a" ], + "features": [], + "deps": { + "components": [], + "third_party": [] + } + }, +##end## + { + "component": "camera_sample_app", + "description": "Camera related samples.", + "optional": "true", + "dirs": [ + "applications/sample/camera/launcher", + "applications/sample/camera/cameraApp", + "applications/sample/camera/setting", + "applications/sample/camera/gallery", + "applications/sample/camera/media" + ], +``` + +#### 4.4修改单板配置文件。 + +修改文件**vendor/hisilicon/hispark_aries/config.json**,新增hello_world_app组件的条目,如下所示代码片段为applications子系统配置,"##start##"和"##end##"之间为新增条目**("##start##"和"##end##"仅用来标识位置,添加完配置后删除这两行):** + +``` +"subsystems": [ +##start## + { + "subsystem": "applications", + "components": [ + { "component": "hello_world_app", "features":[] } + ] + }, +##end## + { + "subsystem": "aafwk", + "components": [ + { "component": "aafwk_lite", "features":[ "enable_ohos_appexecfwk_feature_ability = false" ] } + ] + }, + +``` + +## 5、源码编译 + +#### 5.1设置编译对象 + +- 在源码根目录下执行以下命令进入Docker环境(exit命令退出Docker环境)。 + +``` +sudo docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5 +``` + +- 执行如下命令设置编译路径,“./"(选择当前路径),选择ipcamera_hispark_aries。 + +``` +hb set +``` + +![image-20220214185057969](figures/image-20220214185057969.png) + +#### 5.2开始编译 + +- 执行如下命令进行全量编译(hb build增量编译)。 + + +``` +hb build -f +``` + +![image-20220214185118292](figures/image-20220214185118292.png) + +- 显示ipcamera_hispark_aries build success表示编译成功。 + + +![image-20220214185132546](figures/image-20220214185132546.png) + +- 编译完成后生成以下文件: + + +OHOS_Image.bin、rootfs_jffs2.img、u-boot-hi3518ev300.bin、userfs_jffs2.img + +![image-20220214185208989](figures/image-20220214185208989.png) + +![image-20220214185221861](figures/image-20220214185221861.png) + +## 6、镜像烧录 + +#### 6.1驱动安装 + +##### 6.1.1设备连接 + +这里选择的是USB方式烧录,需同时连接串口和USB。 + +image-20220214153347645 + +image-20220214150918037 + +##### 6.1.2安装USB驱动 + +- 下载USB驱动,[下载地址](https://gitee.com/link?target=http%3A%2F%2Fwww.hihope.org%2Fdownload%2Fdownload.aspx%3Fmtt%3D11) + + +![image-20220128145433087](figures/image-20220128145433087.png) + +- 如果安装驱动后,还提示无法识别的USB设备,将下面内容填入记事本中,保存为一个注册表文件,如test.reg,然后注册。 + + +``` +Windows Registry Editor Version 5.00。 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\12D1D0010100] +"SkipBOSDescriptorQuery"=hex:01,00,00,00 +"osvc"=hex:00,00 +"IgnoreHWSerNum"=hex:01 +``` + +- 如下图,双击进行注册。 + + +![image-20220207101615876](figures/image-20220207101615876.png) + +##### 6.1.3下载Hitool + +- HiTool工具[下载](http://www.hihope.org/download/download.aspx?mtt=33) + + +#### 6.2烧录工具配置 + +##### 6.2.1拷出烧录文件 + +编译完成后,将以下文件拷出至windows下。 + +OHOS_Image.bin(./out/hispark_aries/ipcamera_hispark_aries/) + +rootfs_jffs2.img(./out/hispark_aries/ipcamera_hispark_aries/) + +userfs_jffs2.img(./out/hispark_aries/ipcamera_hispark_aries/) + +u-boot-hi3518ev300.bin(./device/hisilicon/hispark_aries/sdk_liteos/uboot/out/boot/) + +![image-20220214191549299](figures/image-20220214191549299.png) + +![image-20220214191608718](figures/image-20220214191608718.png) + +##### 6.2.2查看串口号 + +打开电脑的设备管理器,查看并记录对应的串口号,如果对应的串口异常,请根据[Hi3516DV300/Hi3518EV300开发板串口驱动安装指导](https://device.harmonyos.com/cn/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695) 安装USB转串口的驱动程序。 + +![image-20220128145330230](figures/image-20220128145330230.png) + +##### 6.2.3使用HiTools烧录,按如下图配置 + +![image-20220214192217347](figures/image-20220214192217347.png) + +##### 6.2.4开始烧写 + +- 点击擦除,插拔USB线。 + + +![image-20220214150647167](figures/image-20220214150647167.png) + +![image-20220214192622299](figures/image-20220214192622299.png) + +- 擦除成功后,传输方式改成USB,烧写文件全勾上,点击烧写。 + +![image-20220214192834790](figures/image-20220214192834790.png) + +#### 6.3烧录完成 + +![image-20220214193209287](figures/image-20220214193209287.png) + +## 7、镜像运行 + +- 打开终端 + +在终端1窗口设置正确端口号,如COM3。 + +![image-20220214193257968](figures/image-20220214193257968.png) + +- 执行命令 + +第一次烧录3.0镜像后,还需要设置BootLoader引导程序,才能运行OpenHarmony系统。重启开发板,迅速按回车,执行如下命令。命令解释请参考官网[命令](https://gitee.com/openharmony/docs/blob/OpenHarmony-3.0-LTS/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3518-running.md#li9441185382314) 。 + +``` +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"; +save; +reset +``` + +![image-20220215094530593](figures/image-20220215094530593.png) + +- 进入bin目录,可看到helloworld文件 + +![image-20220215094551813](figures/image-20220215094551813.png) + +- 运行helloworld文件 + +执行如下命令运行helloworld文件。 + +``` +./helloworld +``` + +![image-20220215094617942](figures/image-20220215094617942.png) + diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220128145330230.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220128145330230.png new file mode 100644 index 0000000000000000000000000000000000000000..734ece199d3b290fe6c3c2c1ffa7487cc1be671f Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220128145330230.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220128145433087.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220128145433087.png new file mode 100644 index 0000000000000000000000000000000000000000..e6197efdc7ddeafd84baea30d38661c38d3568d9 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220128145433087.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220207101615876.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220207101615876.png new file mode 100644 index 0000000000000000000000000000000000000000..b81b51ec399cfcab21ec85d8cd2b1732e6237573 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220207101615876.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220211104009136.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220211104009136.png new file mode 100644 index 0000000000000000000000000000000000000000..cdb625e6a6bffbbe4b9cc9d0fd20533554522b3b Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220211104009136.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214144857618.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214144857618.png new file mode 100644 index 0000000000000000000000000000000000000000..da02b0a36f2ab262e1a0a49138db91b3e58b26c2 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214144857618.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214150424561.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214150424561.png new file mode 100644 index 0000000000000000000000000000000000000000..46e5abba322a811dd3529d75d7228e896e16752a Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214150424561.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214150647167.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214150647167.png new file mode 100644 index 0000000000000000000000000000000000000000..762393d3490a84c435cc81ac4c60fcfabcb6ad8d Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214150647167.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214150918037.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214150918037.png new file mode 100644 index 0000000000000000000000000000000000000000..a8ee85b809d15618ff6b20a77a79ccd7bf0a96fc Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214150918037.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214153347645.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214153347645.png new file mode 100644 index 0000000000000000000000000000000000000000..f48672eafa0adda3b91f2264e1b63f9e408fa0a9 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214153347645.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214153648895.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214153648895.png new file mode 100644 index 0000000000000000000000000000000000000000..21a0ebce04aaab084844daacb4e141cbffeb8ca2 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214153648895.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214153841136.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214153841136.png new file mode 100644 index 0000000000000000000000000000000000000000..ae32bfec616d7666fe089ad1707b969b5fb9e2fc Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214153841136.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214154643872.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214154643872.png new file mode 100644 index 0000000000000000000000000000000000000000..c54277e062ee3f1fa4e86654456eb77554bff9d0 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214154643872.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214155110729.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155110729.png new file mode 100644 index 0000000000000000000000000000000000000000..3092fb5eec11c48dd348fb30267fed129f8d9dbd Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155110729.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214155240691.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155240691.png new file mode 100644 index 0000000000000000000000000000000000000000..e0ca6721721ef55a846aa3586ae71eafef3fc36f Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155240691.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214155625884.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155625884.png new file mode 100644 index 0000000000000000000000000000000000000000..041d60cd64a189bd0fa95b82c74bc20a3e156054 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155625884.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214155933615.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155933615.png new file mode 100644 index 0000000000000000000000000000000000000000..aad9f9bc5534afaa9d8e3df813fc2b72490614f1 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214155933615.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214160306463.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214160306463.png new file mode 100644 index 0000000000000000000000000000000000000000..9ff8554507a79698de043f57fe35980b17ea6ab6 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214160306463.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214160408832.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214160408832.png new file mode 100644 index 0000000000000000000000000000000000000000..d6f7f310d177e6fd87bbb68b4509862eba514529 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214160408832.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214160908581.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214160908581.png new file mode 100644 index 0000000000000000000000000000000000000000..ca3e4a7f11e4a5b948ba046b0276058cf8657ad4 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214160908581.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214161017670.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214161017670.png new file mode 100644 index 0000000000000000000000000000000000000000..d200bc4508d08ea6cb10f9bff4c7f816f75a5e4e Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214161017670.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214161513343.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214161513343.png new file mode 100644 index 0000000000000000000000000000000000000000..b0c5f7a202015131eb7ee2dedb8e611a272d9e2c Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214161513343.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214162210379.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214162210379.png new file mode 100644 index 0000000000000000000000000000000000000000..af4bb48553e1c4b54a27feece7b5b12bd9186b40 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214162210379.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214163111424.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214163111424.png new file mode 100644 index 0000000000000000000000000000000000000000..e69fcfbd7dca20f8619d60449b2069aabb392abc Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214163111424.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214163417927.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214163417927.png new file mode 100644 index 0000000000000000000000000000000000000000..b6c0aee6e853d09cf7b6bdfed2ec81d4770bcf89 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214163417927.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214173837395.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214173837395.png new file mode 100644 index 0000000000000000000000000000000000000000..f17d1be9f71ebf900814157180422d55a80cb56c Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214173837395.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214185057969.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185057969.png new file mode 100644 index 0000000000000000000000000000000000000000..b0c5f7a202015131eb7ee2dedb8e611a272d9e2c Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185057969.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214185118292.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185118292.png new file mode 100644 index 0000000000000000000000000000000000000000..af4bb48553e1c4b54a27feece7b5b12bd9186b40 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185118292.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214185132546.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185132546.png new file mode 100644 index 0000000000000000000000000000000000000000..e69fcfbd7dca20f8619d60449b2069aabb392abc Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185132546.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214185208989.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185208989.png new file mode 100644 index 0000000000000000000000000000000000000000..ca3e4a7f11e4a5b948ba046b0276058cf8657ad4 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185208989.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214185221861.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185221861.png new file mode 100644 index 0000000000000000000000000000000000000000..d200bc4508d08ea6cb10f9bff4c7f816f75a5e4e Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214185221861.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214191549299.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214191549299.png new file mode 100644 index 0000000000000000000000000000000000000000..ca3e4a7f11e4a5b948ba046b0276058cf8657ad4 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214191549299.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214191608718.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214191608718.png new file mode 100644 index 0000000000000000000000000000000000000000..d200bc4508d08ea6cb10f9bff4c7f816f75a5e4e Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214191608718.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214192217347.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192217347.png new file mode 100644 index 0000000000000000000000000000000000000000..46e5abba322a811dd3529d75d7228e896e16752a Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192217347.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214192622299.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192622299.png new file mode 100644 index 0000000000000000000000000000000000000000..21a0ebce04aaab084844daacb4e141cbffeb8ca2 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192622299.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214192714147.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192714147.png new file mode 100644 index 0000000000000000000000000000000000000000..ae32bfec616d7666fe089ad1707b969b5fb9e2fc Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192714147.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214192834790.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192834790.png new file mode 100644 index 0000000000000000000000000000000000000000..c54277e062ee3f1fa4e86654456eb77554bff9d0 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214192834790.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214193153208.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214193153208.png new file mode 100644 index 0000000000000000000000000000000000000000..e2541fe89b43efd46091b1ba092be7bd7afb3192 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214193153208.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214193209287.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214193209287.png new file mode 100644 index 0000000000000000000000000000000000000000..3092fb5eec11c48dd348fb30267fed129f8d9dbd Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214193209287.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220214193257968.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220214193257968.png new file mode 100644 index 0000000000000000000000000000000000000000..041d60cd64a189bd0fa95b82c74bc20a3e156054 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220214193257968.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220215094530593.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220215094530593.png new file mode 100644 index 0000000000000000000000000000000000000000..aad9f9bc5534afaa9d8e3df813fc2b72490614f1 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220215094530593.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220215094551813.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220215094551813.png new file mode 100644 index 0000000000000000000000000000000000000000..9ff8554507a79698de043f57fe35980b17ea6ab6 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220215094551813.png differ diff --git a/docs/hi3518_ev300_small_helloworld/figures/image-20220215094617942.png b/docs/hi3518_ev300_small_helloworld/figures/image-20220215094617942.png new file mode 100644 index 0000000000000000000000000000000000000000..d6f7f310d177e6fd87bbb68b4509862eba514529 Binary files /dev/null and b/docs/hi3518_ev300_small_helloworld/figures/image-20220215094617942.png differ