45 Star 289 Fork 246

OpenHarmony-SIG / knowledge_demo_smart_home

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 8.95 KB
一键复制 编辑 原始数据 按行查看 历史

BES2600快速上手指导文档

一. 简介

芯片介绍

BES2600是恒玄科技设计的一款集成Cortex-M33 Star 双核和Cortex-A7双核的IC。网络连接方面支持WiFi和BLE双模,图形图像方面支持标准MIPI DSI和CSI 设备,目前已支持OpenHarmony轻量级系统。可广泛应用于智能家居、安防、工业控制等多种交互场景。

开发板介绍

Multi-modal V200Z-R开发板是基于恒玄科技BES2600WM芯片,由湖南欧智通科技有限公司出品的一款高性能、多功能、高性价比AIoT SoC开发板Multi-modal V200Z-R开发板,单模组集成四核ARM处理器(最高主频1GHz),集成双频WiFi + 双模蓝牙,支持标准的802.11 a/b/g/n/协议,支持BT/BLE 5.2协议,内建多种容量的RAM(最大42MB)和Flash(最大32MB),支持MIPI DSI及CSI,适用于各种AIoT多模态VUI + GUI交互硬件场景。

开发板实物图如下:

 

二. 快速上手

1. 环境搭建

开发基础环境由windows 工作台和Linux编译服务器组成。windows 工作台可以通过samba 服务或ssh 方式访问Linux编译服务器。其中windows 工作台用来烧录和代码编辑,Linux编译服务器用来编译OpenHarmony代码,为了简化步骤,Linux编译服务器安装Ubuntu20.04。

安装编译依赖基础软件
sudo apt-get install -y build-essential gcc g++ make zlib* libffi-dev git git-lfs python
安装和配置Python
  1. 打开Linux编译服务器终端。

  2. 输入如下命令,查看python3版本号,需使用python3.8以上版本。

python3 --version
  1. 安装并升级Python包管理工具(pip3),任选如下一种方式。

命令行方式:

sudo apt-get install python3-setuptools python3-pip -y
sudo pip3 install --upgrade pip

安装包方式:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
  1. 设置相关pip 包的安装源
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
安装工具链
  • 编译链工具推荐gcc-arm-none-eabi-10-2020-q4-major。点击下载地址进行下载。

  • 将gcc-arm-none-eabi-10-2020-q4-major包解压到~/tools目录下

    tar -zxvf gcc-arm-none-eabi-10-2020-q4-major.tar.gz -C ~/tools/

2. 获取源码

安装码云repo工具
cd ~/
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > ./repo
chmod a+x ./repo
sudo mv ./repo /usr/local/bin/
代码下载
  1. OpenHarmony代码下载,以OpenHarmony 3.1 Beta版本为例,下载方式如下:
mkdir ~/openharmony
cd ~/openharmony

repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1-Beta --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
安装hb
  1. 进入代码工程目录
cd ~/openharmony
  1. 输入hb -v

​ a. 若提示如下提示,则表示未安装可以从第2步开始操作。

hb: command not found

​ b.若有如下提示(版本小于0.4.4),需要先卸载该版本,然后再执行第2步操作步骤。

[OHOS INFO] hb version 0.4.3

​ 卸载命令:

 pip3 uninstall ohos-build 
  1. 运行如下命令安装hb
pip3 install build/lite
  1. 设置环境变量
vim ~/.bashrc

将以下命令拷贝到.bashrc文件的最后一行,保存并退出。

export PATH=~/.local/bin:$PATH

执行如下命令更新环境变量。

source ~/.bashrc
  1. 再次执行”hb -v“,有以下版本显示则表示安装的hb版本正确。
[OHOS INFO] hb version 0.4.4

3. 编写自己的hello world

​ 1. 在vendor/bestechnic/display_demo创建demo_hello_world文件夹

cd ~/openharmony/vendor/bestechnic/display_demo/
mkdir demo_hello_world

​ 2. 然后创建hello_world.c 以及BUILD.gn

cd demo_hello_world
touch hello_world.c
touch BUILD.gn
  1. 在hello_world.c中添加以下代码
#include <stdio.h>
#include <string.h>

#include "ohos_init.h"

int DemoMain(int argc, char **argv)
{
	printf("\r\nhello world!\r\n\r\n");
	return 0;
}

SYS_RUN(DemoMain);
  1. 在BUILD.gn中添加以下代码
static_library("hello_world"){
    sources = [
        "hello_world.c"
    ]
}
  1. 将helloworld添加到编译中,在 ~/openharmony/vendor/bestechnic/display_demo/BUILD.gn中添加以下依赖:

将原有tests:example 替换成为 demo_hello_world:hello_world

diff --git a/display_demo/BUILD.gn b/display_demo/BUILD.gn
index 4ba3d88..beb1883 100755
--- a/display_demo/BUILD.gn
+++ b/display_demo/BUILD.gn
@@ -12,5 +12,6 @@
 # limitations under the License.
 
 group("display_demo") {
-  deps = [ "tests:example" ]
-}
\ No newline at end of file
+  #deps = [ "tests:example" ]
+  deps = [ "demo_hello_world:hello_world" ]
+}
  1. 修改config.json 文件 ~/openharmony/vendor/bestechnic/display_demo/BUILD.gn 文件中添加”hello_world", 移除example、ability_test、fs_test项目
diff --git a/display_demo/config.json b/display_demo/config.json
index fa6f43e..1ccb6e3 100755
--- a/display_demo/config.json
+++ b/display_demo/config.json
@@ -19,10 +19,8 @@
         "bootstrap",
         "abilityms",
         "bundlems",

-        "example",
         "kernel",
-        "ability_test",
-        "fs_test"

+        "hello_world"
         ]
         },

4. 编译

hb set 选择demo指令,具体命令如下:

1)  hb set -root . # 通过键盘选择 display_demo

 

 2)  hb build -f

5. 镜像烧录

由于该L0设备的操作系统和应用被绑定在一个固件里面一起烧录的,所以镜像和固件烧录这里不分开说明

5.1 下载CP210x串口驱动

在浏览器打开下载链接,点击下载,如图:(注:该串口驱动官网下载链接

image-20220105105358172

5.2 安装CP210x串口驱动

解压“CP210x_Windows_Drivers.zip”,点击: “CP210xVCPInstaller_x64.exe”,如图:

(注:32位系统可以安装x86版本,64位系统可以安装x64版本)

image-20220105105635907

安装完毕,点击“完成”,如图:

image-20220105105918434

链接好开发板(BES2600开发板的“烧录”和“电源”接口可以分别通过type_c链接到电脑),如图:

image-20220104181553818

5.3 打开WIFI烧录工具

点击“Wifi_download_main.exe”,如图:

(注:当编译完毕、固件生成成功后,该烧录工具 “Wifi_download_main.exe” 就会自动被生成在:工程"openharmony/out/v200zr/display_demo/write_flash_gui"文件夹下)

image-20220113213729150

打开后,如图:

image-20211227213420024

鼠标右键点击PC右下角,打开:“设备管理器(M)”,如图:

(注: 打开设备管理器前,请确保CP210x串口驱动是否安装)

搜索 “端口 -> USB SERIAL Port(COM10*)",需要记住COM*,每台设备的不一样,如图:

(注:假如端口没显示,请拔掉usb口再插上或更换usb线)

image-20220105102452921

选择对应的com口,点击“OK”,如图:

image-20211227213459987

按下BES2600开发板背面的复位Reset按钮,如图:

image-20211227220118323

5.4 开始烧录

此时,显示进度表示开始烧录,如图:

image-20211227213559655

5.5 烧录成功

当进度显示100%时候,表示烧录完毕,如图:

image-20211227213711293

6. 运行

待第5步固件烧录成功后,开启PC串口调试工具。程序将运行且看到以下打印输出。

备注: 开源串口调试工具llcom链接

具体步骤:1)打开llcom.exe 文件,点击更多设置->串口基本设置-> 将串口数据显示方式设置成:只显示文本数据;

​ 2)选择对应串口,设置波特率位1500000;

​ 3)点击llcom程序窗口中的打开串口按钮,按下复位按钮复位开发板。

image-20211227213711293

1
https://gitee.com/openharmony-sig/knowledge_demo_smart_home.git
git@gitee.com:openharmony-sig/knowledge_demo_smart_home.git
openharmony-sig
knowledge_demo_smart_home
knowledge_demo_smart_home
master

搜索帮助