開(kāi)發(fā)環(huán)境:
開(kāi)發(fā)系統(tǒng):Ubuntu 20.04
開(kāi)發(fā)板:HiSparkIPCCamera(Hi3518)
新建工程及配置
1.新建工程及源碼
1) 新建目錄
$ mkdir hello
(左右移動(dòng)查看全部?jī)?nèi)容)
在applications/sample/hello中新建src目錄以及helloworld.c文件,代碼如下所示。
int main(int argc, char **argv)
{
printf(" ");
printf(" Hello OHOS! ");
printf(" ");
return 0;
}
(左右移動(dòng)查看全部?jī)?nèi)容)
2) 新建編譯組織文件
新建applications/sample/hello/BUILD.gn文件,內(nèi)容如下所示:
import("http://build/lite/config/component/lite_component.gni")
lite_component("hello-OHOS"){
features = [ ":helloworld" ]
}
executable("helloworld"){
output_name = "helloworld"
sources = [ "src/helloworld.c" ]
}
(左右移動(dòng)查看全部?jī)?nèi)容)
新建的工程目錄如下:
$ tree
(左右移動(dòng)查看全部?jī)?nèi)容)
2.添加新組件
修改文件build/lite/components/applications.json,添加組件hello_world_app的配置。
{
"component":"hello_world_app",
"description": "helloworld samples.",
"optional": "true",
"dirs": [
"applications/sample/hello"
],
"targets": [
"http://applications/sample/hello:hello-OHOS"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": ["liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
}
(左右移動(dòng)查看全部?jī)?nèi)容)
3.修改單板配置文件
修改文件vendor/hisilicon/hispark_aries/config.json,新增hello_world_app組件的條目。
{
"subsystem":"applications",
"components": [
{ "component":"hello_world_app", "features":[] }
}
(左右移動(dòng)查看全部?jī)?nèi)容)
編譯下載驗(yàn)證
接下來(lái)就可以編譯了:
$ hb set
(左右移動(dòng)查看全部?jī)?nèi)容)
全編譯:
$ hb build -f
(左右移動(dòng)查看全部?jī)?nèi)容)
在bin文件就會(huì)有helloworld應(yīng)用:
和以前一樣,拷貝ohos_image.bin, rootfs_jffs2.img, useRFs_jffs2.img三個(gè)文件是。然后把固件下載到板子中。
燒寫(xiě)成功后,運(yùn)行bin目錄下的helloworld。
接下來(lái)就可以根據(jù)該實(shí)例開(kāi)發(fā)自己的應(yīng)用了。
原文標(biāo)題:鴻蒙開(kāi)發(fā)板試用: IPC Camera 開(kāi)發(fā)板應(yīng)用開(kāi)發(fā)
文章出處:【微信公眾號(hào):HarmonyOS官方合作社區(qū)】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
-
源碼
+關(guān)注
關(guān)注
8文章
652瀏覽量
29452 -
開(kāi)發(fā)板
+關(guān)注
關(guān)注
25文章
5121瀏覽量
98193 -
Hi3518
+關(guān)注
關(guān)注
0文章
8瀏覽量
5398
原文標(biāo)題:鴻蒙開(kāi)發(fā)板試用: IPC Camera 開(kāi)發(fā)板應(yīng)用開(kāi)發(fā)
文章出處:【微信號(hào):HarmonyOS_Community,微信公眾號(hào):電子發(fā)燒友開(kāi)源社區(qū)】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論