开发环境:
开发系统:Ubuntu 20.04
开发板:HiSparkIPCCamera(Hi3518)
新建工程及配置
1.新建工程及源码
1) 新建目录
$ mkdir hello
(左右移动查看全部内容)
在applications/sample/hello中新建src目录以及helloworld.c文件,代码如下所示。
int main(int argc, char **argv){printf(" ");printf(" Hello OHOS! ");printf(" ");return 0;}
(左右移动查看全部内容)
2) 新建编译组织文件
新建applications/sample/hello/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" ]}
(左右移动查看全部内容)
新建的工程目录如下:
$ tree
(左右移动查看全部内容)

2.添加新组件
修改文件build/lite/components/applications.json,添加组件hello_world_app的配置。
{"component":"hello_world_app","description": "helloworld samples.","optional": "true","dirs": ["applications/sample/hello"],"targets": ["//applications/sample/hello:hello-OHOS"],"rom": "","ram": "","output": [],"adapted_kernel": ["liteos_a" ],"features": [],"deps": {"components": [],"third_party": []}}
(左右移动查看全部内容)

3.修改单板配置文件
修改文件vendor/hisilicon/hispark_aries/config.json,新增hello_world_app组件的条目。
{"subsystem":"applications","components": [{ "component":"hello_world_app", "features":[] }}
(左右移动查看全部内容)

编译下载验证
接下来就可以编译了:
$ hb set
(左右移动查看全部内容)

全编译:
$ hb build -f
(左右移动查看全部内容)

在bin文件就会有helloworld应用:

和以前一样,拷贝ohos_image.bin, rootfs_jffs2.img, useRFs_jffs2.img三个文件是。然后把固件下载到板子中。

烧写成功后,运行bin目录下的helloworld。

接下来就可以根据该实例开发自己的应用了。
原文标题:鸿蒙开发板试用: IPC Camera 开发板应用开发
文章出处:【微信公众号:HarmonyOS官方合作社区】欢迎添加关注!文章转载请注明出处。
全部0条评论
快来发表一下你的评论吧 !