当前位置:网站首页>Yocto add application
Yocto add application
2022-06-09 06:04:00 【SlamDunk31598】
1、 Already exist meta Add to layer
such as yocto Project directory meta-semidrive/recipes-bsp Under the folder , newly build hello-bsp Folder ,
hello-bsp Add the following source files to the folder :
.
├── hello-bsp
│ ├── inc
│ ├── LICENSE
│ ├── Makefile
│ └── src
│ └── hello_bsp.c
└── hello-bsp.bb
2、bb Document writing
hello-bsp.bb In file SRC_URI Specify the file path used for compilation ,S Specifies that the generated image path is located at build/work/ Next ;
do_compile、do_install Specify compilation and deployment methods
1 SUMMARY = "hello examples demo"
2
3 LICENSE = "BSD"
4 LIC_FILES_CHKSUM = "file://LICENSE;md5=b30cbe0b980e98bfd9759b1e6ba3d107"
5
6
7 SRC_URI = "\
8 file://LICENSE \
9 file://Makefile \
10 file://src/hello_bsp.c \
11 "
12
13 S = "${WORKDIR}"
14
15 FILES_${PN} = "\
16 /usr/bin/hello_bsp\
17 "
18 do_compile() {
19 make MACHINE=${MACHINE}
20 }
21
22 do_install () {
23 install -d ${D}/usr/bin
24 install -m 0755 hello_bsp ${D}/usr/bin/hello_bsp
25 } 3、Makefile
1 APP := hello_bsp
2
3 HELLO_BSP_OBJ := src/hello_bsp.o
4
5 CFLAGS += -Wall -Werror
6
7 all: $(APP)
8
9 hello_bsp: $(HELLO_BSP_OBJ)
10 $(CC) $(LDFLAGS) -o [email protected] $^ $(LDLIBS) -lpthread
11
12 %.o: %.c
13 $(CC) -c $(CFLAGS) -o [email protected] $^ -I inc/
14
15 clean:
16 rm -rf $(APP) hello_bsp src/*.o 4、hello_bsp.c Source file
1 /*
2 * hello.c
3 *
4 * Copyright (c) 2020 Slamdunk.
5 * All rights reserved.
6 *
7 * Description:
8 *
9 * Revision History:
10 * -----------------
11 */
12 #include <stdio.h>
13
14 int main()
15 {
16 printf("hello yfve bsp\r\n");
17 return 0;
18 } 5、 compile
bitbake hello-bsp
$ bitbake hello-bsp
WARNING: Layer x9-gen1 should set LAYERSERIES_COMPAT_x9-gen1 in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: Layer x9-gen1 should set LAYERSERIES_COMPAT_x9-gen1 in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: You have included the meta-gnome layer, but 'x11' has not been enabled in your DISTRO_FEATURES. Some bbappend files may not take effect. See the meta-gnome README for details on enabling meta-gnome support.
Loading cache: 100% |###############################################################################################################################| Time: 0:00:00
Loaded 3118 entries from dependency cache.
Parsing recipes: 85% |########################################################################################################### | ETA: 0:00:00
The compiled file is located in :
tmp/work/aarch64-sdrv-linux/hello-bsp/1.0-r0/image/usr/bin/hello_bsp
file tmp/work/aarch64-sdrv-linux/hello-bsp/1.0-r0/image/usr/bin/hello_bsp
tmp/work/aarch64-sdrv-linux/hello-bsp/1.0-r0/image/usr/bin/hello_bsp: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.14.0, BuildID[sha1]=ae7bf505abc6b562980916ef1f64c519055ce77e, not stripped6、 Add to yocto Integration of rootfs in
IMAGE_INSTALL_append = "hello-bsp \"
Recompile the whole project :bitbake core-image-base
tmp/work/x9h_ref_serdes-sdrv-linux/core-image-base/1.0-r0/rootfs/usr/bin/hello_bsp
边栏推荐
猜你喜欢

After the SSL certificate is installed, the website still shows insecurity

iTOP-2K1000開發板啟動ramdisk-制作啟動U盤

Complete jitsi meet guide for webrtc
![[reprint] LCD common interface principle](/img/c5/df2fa2703c973b119ef97239656855.jpg)
[reprint] LCD common interface principle

Tensorflow introductory tutorial 02 basic concepts of tensorflow (data flow graph, tensor, tensorboard)

What information does the SSL certificate contain?

Complete webrtc video recording in five minutes

Interpretation of join method in thread

Oracle lock table solution

NAND flash Basics
随机推荐
Go language tutorial 02 go common libraries + compile consult
srs-nodejs
Topic24——3. Longest substring without duplicate characters
[paper] cbam: revolutionary block attention module
SSC spread spectrum
抽象类和接口
图像处理-特征融合相关延伸
Detailed understanding and learning of transactions in MySQL (transaction management, transaction isolation level, transaction propagation mechanism)
Atlas7 NAND stress test program
C # characteristic
Typescript IntelliSense is disabled on template error
Synchronized detailed parsing
对多旅行商问题:应用、方法和分类进行了全面的综述
C# 协变逆变
测试和线程
Educational Codeforces Round 20 E. Roma and Poker
fatal: repository not found
使用 __proto__ 来分配原型
Traitement d'images - extension de la corrélation de fusion de fonctions
Ipop-imx6q development board qt5.7 system Mplayer migration - Cross compilation libmad-0.15.1b