HiSparkIPCCamera(Hi3518)开发板应用开发

描述

开发环境:

开发系统:Ubuntu 20.04

开发板:HiSparkIPCCamera(Hi3518)

 

新建工程及配置

1.新建工程及源码

1) 新建目录

  •  
$ mkdir hello

(左右移动查看全部内容)

 

在applications/sample/hello中新建src目录以及helloworld.c文件,代码如下所示。

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    #include 
    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官方合作社区】欢迎添加关注!文章转载请注明出处。

 
审核编辑:汤梓红
打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分