Yocto系统添加程序——RZMPU工业控制教程连载(62)

瑞萨MCU小百科 2025-03-06 12:00


14.7

Yocto系统添加程序

14.7.1 快速增加软件包

在Yocto中如果我们期望在rootfs中添加一些软件,例如可能是bash,可能是lsusb等,那么,我们可以有两种方法:


  • 手动添加,一个个文件的拷贝。

  • 或者在bb文件中添加安装项目,让Yocto自动帮助我们添加。


第一种方法需要手动将软件包的所有文件以及依赖都一个个添加进去,耗时耗力且易错,因此使用第二中方法比较合适。


Yocto中Rootfs中添加软件包的步骤

找到打包rootfs的最终bb


如果我们使用的是bitbake myir-image-full编译命令。


那么,我们可以按照如下来搜索myir-image-full这个软件包(任务),使用的是哪个bb文件:



在meta-myir-remi/recipes-images/images/myir-image-full.bb里面添加我们需要的软件包。


我们只需要在IMAGE_INSTALL后面参考添加需要的软件包。



参考下图所示,在最底部增加一个lsusb软件包,增加完成后,保存退出即可。



再次回到编译空间~/renesas/yocto/myir-renesas-yocto/build-remi-1g目录内,执行bitbake myir-image-full-k命令就可以自动将我们增加的lsusb编译至最终系统内。


14.7.2 自定义本地bb软件包

Yocto中一个软件包是放在bb文件中的,然后很多的bb 文件集成一个recipe(配方),然后许多的recipe又组成一个meta layer,因此,要添加一个包其实就是在recipe下面添加一个bb(bitbake配置文件)。下面使用helloworld作为一个例子。


1

创建hello bb文件

例如下面就是到了meta-myir-remi layer里面找到一个名为recipes-demo配方增加我们的hello bb文件。


一个软件包的结构使用tree可以看到,其有一个bb文件,然后其中还有一个目录放着Makefile与source code:


2

bb文件内容

其中的bb文件内容如下:

左右滑动查看完整内容

DESCRIPTION = "Hello World and Zlib test"DEPENDS = "zlib"SECTION = "libs"LICENSE = "MIT"PV = "3"PR = "r0"
SRC_URI = " \ file://helloYocto.c \ file://zlibtest.c \ file://makefile \ " LIC_FILES_CHKSUM = "file://helloYocto.c;md5=4c53a1f5243efa8c4d5ec1c3909d2c1f"S = "${WORKDIR}"do_compile () { make}
do_install () {install -d ${D}/usr/bin \
install -m 0755 ${S}/helloYocto ${D}/usr/bininstall -m 0755 ${S}/zlibtest ${D}/usr/bin}
FILES_${PN} = " \/usr/bin \"


可以看到,bb文件中指定了下面几个变量的值:


  • SRC_URI

  • LIC_FILES_CHKSUM:这个是checksum,如果是基于版本管理的source,那么不需要,例如git 与svn

  • FILES_$(PN):PN是Package number,指代软件版本使用的PV与PR结合表示,即前面bitbake -s中看到的3-r0


还有两个方法,这2个方法重载了bitbake中默认方法:


  • do_compile

  • do_install


这两个方法,对应了Package中的compile与install task。


3

应用程序编写

左右滑动查看完整内容

ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-yocto/layers/meta-myir-remi/recipes-demos/hello$ cd hello/ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-yocto/layers/meta-myir-remi/recipes-demos/hello/hello$ lshelloYocto.c makefile zlibtest.c


左右滑动查看完整内容

ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-yocto/layers/meta-myir-remi/recipes-demos/hello/hello$ cat helloYocto.c #include#include#include 
int main(int argc,char *argv[]){
printf("Hello World Yocto-SDK !!!"); return 0;}


左右滑动查看完整内容

ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-yocto/layers/meta-myir-remi/recipes-demos/hello/hello$ cat makefile TARGET=helloYocto zlibtestLDFLAGS= -lz
all: $(TARGET)helloYocto: helloYocto.o$(CC) $(CFLAGS) -o $@ $^
zlibtest: zlibtest.o$(CC) $(CFLAGS1) -o $@ $^ $(LDFLAGS)
clean:rm -f $(OBJS) $(TARGET)


左右滑动查看完整内容

ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-yocto/layers/meta-myir-remi/recipes-demos/hello/hello$ cat zlibtest.c /* gun.c -- simple gunzip to give an example of the use of inflateBack()* Copyright (C) 2003, 2005, 2008, 2010, 2012 Mark Adler* For conditions of distribution and use, see copyright notice in zlib.h Version 1.7 12 August 2012 Mark Adler */ /* Version history: 1.0 16 Feb 2003 First version for testing of inflateBack() 1.1 21 Feb 2005 Decompress concatenated gzip streams Remove use of "this" variable (C++ keyword) Fix return value for in() Improve allocation failure checking


左右滑动查看完整内容

Add typecasting for void * structures Add -h option for command version and usage Add a bunch of comments 1.2 20 Mar 2005 Add Unix compress (LZW) decompression Copy file attributes from input file to output file 1.3 12 Jun 2005 Add casts for error messages [Oberhumer] 1.4 8 Dec 2006 LZW decompression speed improvements 1.5 9 Feb 2008 Avoid warning in latest version of gcc 1.6 17 Jan 2010 Avoid signed/unsigned comparison warnings 1.7 12 Aug 2012 Update for z_const usage in zlib 1.2.8*/
/* gun [ -t ] [ name ... ] decompresses the data in the named gzip files. If no arguments are given, gun will decompress from stdin to stdout. The names must end in .gz, -gz, .z, -z, _z, or .Z. The uncompressed data will be written to a file name with the suffix stripped. On success, the original file is deleted. On failure, the output file is deleted. For most failures, the command will continue to process the remaining names on the command line. A memory allocation failure will abort the command. If -t is specified, then the listed files or stdin will be tested as gzip files for integrity (without checking for a proper suffix), no output will be written, and no files will be deleted. Like gzip, gun allows concatenated gzip streams and will decompress them, writing all of the uncompressed data to the output. Unlike gzip, gun allows an empty file on input, and will produce no error writing an empty output file. gun will also decompress files made by Unix compress, which uses LZW compression. These files are automatically detected by virtue of their magic header bytes. Since the end of Unix compress stream is marked by the end-of-file, they cannot be concantenated. If a Unix compress stream is encountered in an input file, it is the last stream in that file. Like gunzip and uncompress, the file attributes of the orignal compressed file are maintained in the final uncompressed file, to the extent that the user permissions allow it. On my Mac OS X PowerPC G4, gun is almost twice as fast as gunzip (version 1.2.4) is on the same file, when gun is linked with zlib 1.2.2. Also the LZW decompression provided by gun is about twice as fast as the standard Unix uncompress command. */ /* external functions and related types and constants */#include /* fprintf() */#include /* malloc(), free() */#include /* strerror(), strcmp(), strlen(), memcpy() */#include /* errno */#include /* open() */#include /* read(), write(), close(), chown(), unlink() */#include #include /* stat(), chmod() */


左右滑动查看完整内容

#include  /* utime() */#include "zlib.h" /* inflateBackInit(), inflateBack(), */ /* inflateBackEnd(), crc32() */ /* function declaration */#define local static
/* buffer constants */#define SIZE 32768U /* input and output buffer sizes */#define PIECE 16384 /* limits i/o chunks for 16-bit int case */
/* structure for infback() to pass to input function in() -- it maintains the input file and a buffer of size SIZE */struct ind { int infile; unsigned char *inbuf;};
/* Load input buffer, assumed to be empty, and return bytes loaded and a pointer to them. read() is called until the buffer is full, or until it returns end-of-file or error. Return 0 on error. */local unsigned in(void *in_desc, z_const unsigned char **buf){ int ret; unsigned len; unsigned char *next; struct ind *me = (struct ind *)in_desc; next = me->inbuf; *buf = next; len = 0; do { ret = PIECE; if ((unsigned)ret > SIZE - len) ret = (int)(SIZE - len); ret = (int)read(me->infile, next, ret); if (ret == -1) { len = 0; break; } next += ret; len += ret; } while (ret != 0 && len < SIZE); return len;}
/* structure for infback() to pass to output function out() -- it maintains the output file, a running CRC-32 check on the output and the total number of bytes output, both for checking against the gzip trailer. (The length in the gzip trailer is stored modulo 2^32, so it's ok if a long is 32 bits and the output is greater than 4 GB.) */struct outd { int outfile; int check; /* true if checking crc and total */ unsigned long crc; unsigned long total;


左右滑动查看完整内容

};
/* Write output buffer and update the CRC-32 and total bytes written. write() is called until all of the output is written or an error is encountered. On success out() returns 0. For a write failure, out() returns 1. If the output file descriptor is -1, then nothing is written.*/local int out(void *out_desc, unsigned char *buf, unsigned len){ int ret; struct outd *me = (struct outd *)out_desc; if (me->check) { me->crc = crc32(me->crc, buf, len); me->total += len; } if (me->outfile != -1) do { ret = PIECE; if ((unsigned)ret > len) ret = (int)len; ret = (int)write(me->outfile, buf, ret); if (ret == -1) return 1; buf += ret; len -= ret; } while (len != 0); return 0;}
/* next input byte macro for use inside lunpipe() and gunpipe() */#define NEXT() (have ? 0 : (have = in(indp, &next)), \ last = have ? (have--, (int)(*next++)) : -1)
/* memory for gunpipe() and lunpipe() -- the first 256 entries of prefix[] and suffix[] are never used, could have offset the index, but it's faster to waste the memory */unsigned char inbuf[SIZE]; /* input buffer */unsigned char outbuf[SIZE]; /* output buffer */unsigned short prefix[65536]; /* index to LZW prefix string */unsigned char suffix[65536]; /* one-character LZW suffix */unsigned char match[65280 + 2]; /* buffer for reversed match or gzip 32K sliding window */
/* throw out what's left in the current bits byte buffer (this is a vestigial aspect of the compressed data format derived from an implementation that made use of a special VAX machine instruction!) */#define FLUSHCODE() \ do { \ left = 0; \ rem = 0; \ if (chunk > have) { \ chunk -= have; \ have = 0; \ if (NEXT() == -1) \ break; \


左右滑动查看完整内容

chunk--; \ if (chunk > have) { \ chunk = have = 0; \ break; \ } \ } \ have -= chunk; \ next += chunk; \ chunk = 0; \ } while (0) /* Decompress a compress (LZW) file from indp to outfile. The compress magic header (two bytes) has already been read and verified. There are have bytes of buffered input at next. strm is used for passing error information back to gunpipe().  lunpipe() will return Z_OK on success, Z_BUF_ERROR for an unexpected end of file, read error, or write error (a write error indicated by strm->next_in not equal to Z_NULL), or Z_DATA_ERROR for invalid input.*/local int lunpipe(unsigned have, z_const unsigned char *next, struct ind *indp, int outfile, z_stream *strm){ int last; /* last byte read by NEXT(), or -1 if EOF */ unsigned chunk; /* bytes left in current chunk */ int left; /* bits left in rem */ unsigned rem; /* unused bits from input */ int bits; /* current bits per code */ unsigned code; /* code, table traversal index */ unsigned mask; /* mask for current bits codes */ int max; /* maximum bits per code for this stream */ unsigned flags; /* compress flags, then block compress flag */ unsigned end; /* last valid entry in prefix/suffix tables */ unsigned temp; /* current code */ unsigned prev; /* previous code */ unsigned final; /* last character written for previous code */ unsigned stack; /* next position for reversed string */ unsigned outcnt; /* bytes in output buffer */ struct outd outd; /* output structure */ unsigned char *p;  /* set up output */ outd.outfile = outfile; outd.check = 0;  /* process remainder of compress header -- a flags byte */ flags = NEXT(); if (last == -1) return Z_BUF_ERROR; if (flags & 0x60) { strm->msg = (char *)"unknown lzw flags set"; return Z_DATA_ERROR; } max = flags & 0x1f; if (max < 9 || max > 16) { strm->msg = (char *)"lzw bits out of range";


左右滑动查看完整内容

return Z_DATA_ERROR; } if (max == 9) /* 9 doesn't really mean 9 */ max = 10; flags &= 0x80; /* true if block compress */  /* clear table */ bits = 9; mask = 0x1ff; end = flags ? 256 : 255;  /* set up: get first 9-bit code, which is the first decompressed byte, but don't create a table entry until the next code */ if (NEXT() == -1) /* no compressed data is ok */ return Z_OK; final = prev = (unsigned)last; /* low 8 bits of code */ if (NEXT() == -1) /* missing a bit */ return Z_BUF_ERROR; if (last & 1) { /* code must be < 256 */ strm->msg = (char *)"invalid lzw code"; return Z_DATA_ERROR; } rem = (unsigned)last >> 1; /* remaining 7 bits */ left = 7; chunk = bits - 2; /* 7 bytes left in this chunk */ outbuf[0] = (unsigned char)final; /* write first decompressed byte */ outcnt = 1;  /* decode codes */ stack = 0; for (;;) { /* if the table will be full after this, increment the code size */ if (end >= mask && bits < max) { FLUSHCODE(); bits++; mask <<= 1; mask++; } /* get a code of length bits */ if (chunk == 0) /* decrement chunk modulo bits */ chunk = bits; code = rem; /* low bits of code */ if (NEXT() == -1) { /* EOF is end of compressed data */ /* write remaining buffered output */ if (outcnt && out(&outd, outbuf, outcnt)) { strm->next_in = outbuf; /* signal write error */ return Z_BUF_ERROR; } return Z_OK; } code += (unsigned)last << left; /* middle (or high) bits of code */ left += 8; chunk--; if (bits > left) { /* need more bits */ if (NEXT() == -1) /* can't end in middle of code */


左右滑动查看完整内容

return Z_BUF_ERROR; code += (unsigned)last << left; /* high bits of code */ left += 8; chunk--; } code &= mask; /* mask to current code length */ left -= bits; /* number of unused bits */ rem = (unsigned)last >> (8 - left); /* unused bits from last byte */
 /* process clear code (256) */ if (code == 256 && flags) { FLUSHCODE(); bits = 9; /* initialize bits and mask */ mask = 0x1ff; end = 255; /* empty table */ continue; /* get next code */ } /* special code to reuse last match */ temp = code; /* save the current code */ if (code > end) { /* Be picky on the allowed code here, and make sure that the code we drop through (prev) will be a valid index so that random input does not cause an exception. The code != end + 1 check is empirically derived, and not checked in the original uncompress code. If this ever causes a problem, that check could be safely removed. Leaving this check in greatly improves gun's ability to detect random or corrupted input after a compress header. In any case, the prev > end check must be retained. */ if (code != end + 1 || prev > end) { strm->msg = (char *)"invalid lzw code"; return Z_DATA_ERROR; } match[stack++] = (unsigned char)final; code = prev; } /* walk through linked list to generate output in reverse order */ p = match + stack; while (code >= 256) { *p++ = suffix[code]; code = prefix[code]; } stack = p - match; match[stack++] = (unsigned char)code; final = code;
 /* link new table entry */ if (end < mask) { end++; prefix[end] = (unsigned short)prev; suffix[end] = (unsigned char)final; } /* set previous code for next iteration */ prev = temp;


左右滑动查看完整内容


/* write output in forward order */ while (stack > SIZE - outcnt) { while (outcnt < SIZE) outbuf[outcnt++] = match[--stack]; if (out(&outd, outbuf, outcnt)) { strm->next_in = outbuf; /* signal write error */ return Z_BUF_ERROR; } outcnt = 0; } p = match + stack; do { outbuf[outcnt++] = *--p; } while (p > match); stack = 0; /* loop for next code with final and prev as the last match, rem and left provide the first 0..7 bits of the next code, end is the last valid table entry */ }}
/* Decompress a gzip file from infile to outfile. strm is assumed to have been successfully initialized with inflateBackInit(). The input file may consist of a series of gzip streams, in which case all of them will be decompressed to the output file. If outfile is -1, then the gzip stream(s) integrity is checked and nothing is written. The return value is a zlib error code: Z_MEM_ERROR if out of memory, Z_DATA_ERROR if the header or the compressed data is invalid, or if the trailer CRC-32 check or length doesn't match, Z_BUF_ERROR if the input ends prematurely or a write error occurs, or Z_ERRNO if junk (not a another gzip stream) follows a valid gzip stream.*/local int gunpipe(z_stream *strm, int infile, int outfile){ int ret, first, last; unsigned have, flags, len; z_const unsigned char *next = NULL; struct ind ind, *indp; struct outd outd; /* setup input buffer */ ind.infile = infile; ind.inbuf = inbuf; indp = &ind; /* decompress concatenated gzip streams */ have = 0; /* no input data read in yet */ first = 1; /* looking for first gzip header */ strm->next_in = Z_NULL; /* so Z_BUF_ERROR means EOF */ for (;;) { /* look for the two magic header bytes for a gzip stream */ if (NEXT() == -1) { ret = Z_OK;


左右滑动查看完整内容

break; /* empty gzip stream is ok */ } if (last != 31 || (NEXT() != 139 && last != 157)) { strm->msg = (char *)"incorrect header check"; ret = first ? Z_DATA_ERROR : Z_ERRNO; break; /* not a gzip or compress header */ } first = 0; /* next non-header is junk */ /* process a compress (LZW) file -- can't be concatenated after this */ if (last == 157) { ret = lunpipe(have, next, indp, outfile, strm); break; }  /* process remainder of gzip header */ ret = Z_BUF_ERROR; if (NEXT() != 8) { /* only deflate method allowed */ if (last == -1) break; strm->msg = (char *)"unknown compression method"; ret = Z_DATA_ERROR; break; } flags = NEXT(); /* header flags */ NEXT(); /* discard mod time, xflgs, os */ NEXT(); NEXT(); NEXT(); NEXT(); NEXT(); if (last == -1) break; if (flags & 0xe0) { strm->msg = (char *)"unknown header flags set"; ret = Z_DATA_ERROR; break; } if (flags & 4) { /* extra field */ len = NEXT(); len += (unsigned)(NEXT()) << 8; if (last == -1) break; while (len > have) { len -= have; have = 0; if (NEXT() == -1) break; len--; } if (last == -1) break; have -= len; next += len; } if (flags & 8) /* file name */ while (NEXT() != 0 && last != -1) ; if (flags & 16) /* comment */ while (NEXT() != 0 && last != -1) ;


左右滑动查看完整内容

if (flags & 2) { /* header crc */ NEXT(); NEXT(); } if (last == -1) break; /* set up output */ outd.outfile = outfile; outd.check = 1; outd.crc = crc32(0L, Z_NULL, 0); outd.total = 0;  /* decompress data to output */ strm->next_in = next; strm->avail_in = have; ret = inflateBack(strm, in, indp, out, &outd); if (ret != Z_STREAM_END) break; next = strm->next_in; have = strm->avail_in; strm->next_in = Z_NULL; /* so Z_BUF_ERROR means EOF */  /* check trailer */ ret = Z_BUF_ERROR; if (NEXT() != (int)(outd.crc & 0xff) || NEXT() != (int)((outd.crc >> 8) & 0xff) || NEXT() != (int)((outd.crc >> 16) & 0xff) || NEXT() != (int)((outd.crc >> 24) & 0xff)) { /* crc error */ if (last != -1) { strm->msg = (char *)"incorrect data check"; ret = Z_DATA_ERROR; } break; } if (NEXT() != (int)(outd.total & 0xff) || NEXT() != (int)((outd.total >> 8) & 0xff) || NEXT() != (int)((outd.total >> 16) & 0xff) || NEXT() != (int)((outd.total >> 24) & 0xff)) { /* length error */ if (last != -1) { strm->msg = (char *)"incorrect length check"; ret = Z_DATA_ERROR; } break; } /* go back and look for another gzip stream */ } /* clean up and return */ return ret;}
/* Copy file attributes, from -> to, as best we can. This is best effort, so no errors are reported. The mode bits, including suid, sgid, and the sticky bit are copied (if allowed), the owner's user id and group id are copied


左右滑动查看完整内容

(again if allowed), and the access and modify times are copied. */local void copymeta(char *from, char *to){ struct stat was; struct utimbuf when;  /* get all of from's Unix meta data, return if not a regular file */ if (stat(from, &was) != 0 || (was.st_mode & S_IFMT) != S_IFREG) return;  /* set to's mode bits, ignore errors */ (void)chmod(to, was.st_mode & 07777);  /* copy owner's user and group, ignore errors */ (void)chown(to, was.st_uid, was.st_gid);  /* copy access and modify times, ignore errors */ when.actime = was.st_atime; when.modtime = was.st_mtime; (void)utime(to, &when);}
/* Decompress the file inname to the file outnname, of if test is true, just decompress without writing and check the gzip trailer for integrity. If inname is NULL or an empty string, read from stdin. If outname is NULL or an empty string, write to stdout. strm is a pre-initialized inflateBack structure. When appropriate, copy the file attributes from inname to outname. gunzip() returns 1 if there is an out-of-memory error or an unexpected return code from gunpipe(). Otherwise it returns 0.*/local int gunzip(z_stream *strm, char *inname, char *outname, int test){ int ret; int infile, outfile; /* open files */ if (inname == NULL || *inname == 0) { inname = "-"; infile = 0; /* stdin */ } else { infile = open(inname, O_RDONLY, 0); if (infile == -1) { fprintf(stderr, "gun cannot open %s\n", inname); return 0; } } if (test) outfile = -1; else if (outname == NULL || *outname == 0) { outname = "-"; outfile = 1; /* stdout */ } else {


左右滑动查看完整内容

outfile = open(outname, O_CREAT | O_TRUNC | O_WRONLY, 0666); if (outfile == -1) { close(infile); fprintf(stderr, "gun cannot create %s\n", outname); return 0; } } errno = 0;  /* decompress */ ret = gunpipe(strm, infile, outfile); if (outfile > 2) close(outfile); if (infile > 2) close(infile);  /* interpret result */ switch (ret) { case Z_OK: case Z_ERRNO: if (infile > 2 && outfile > 2) { copymeta(inname, outname); /* copy attributes */ unlink(inname);  } if (ret == Z_ERRNO) fprintf(stderr, "gun warning: trailing garbage ignored in %s\n", inname); break; case Z_DATA_ERROR: if (outfile > 2) unlink(outname); fprintf(stderr, "gun data error on %s: %s\n", inname, strm->msg); break; case Z_MEM_ERROR: if (outfile > 2) unlink(outname); fprintf(stderr, "gun out of memory error--aborting\n"); return 1; case Z_BUF_ERROR: if (outfile > 2) unlink(outname); if (strm->next_in != Z_NULL) { fprintf(stderr, "gun write error on %s: %s\n", outname, strerror(errno)); } else if (errno) { fprintf(stderr, "gun read error on %s: %s\n", inname, strerror(errno)); } else { fprintf(stderr, "gun unexpected end of file on %s\n", inname); } break; default: if (outfile > 2) unlink(outname); fprintf(stderr, "gun internal error--aborting\n"); return 1; } return 0;}


左右滑动查看完整内容


/* Process the gun command line arguments. See the command syntax near the beginning of this source file. */int main(int argc, char **argv){ int ret, len, test; char *outname; unsigned char *window; z_stream strm; /* initialize inflateBack state for repeated use */ window = match; /* reuse LZW match buffer */ strm.zalloc = Z_NULL; strm.zfree = Z_NULL; strm.opaque = Z_NULL; ret = inflateBackInit(&strm, 15, window); if (ret != Z_OK) { fprintf(stderr, "gun out of memory error--aborting\n"); return 1; } /* decompress each file to the same name with the suffix removed */ argc--; argv++; test = 0; if (argc && strcmp(*argv, "-h") == 0) { fprintf(stderr, "gun 1.6 (17 Jan 2010)\n"); fprintf(stderr, "Copyright (C) 2003-2010 Mark Adler\n"); fprintf(stderr, "usage: gun [-t] [file1.gz [file2.Z ...]]\n"); return 0; } if (argc && strcmp(*argv, "-t") == 0) { test = 1; argc--; argv++; } if (argc) do { if (test) outname = NULL; else { len = (int)strlen(*argv); if (strcmp(*argv + len - 3, ".gz") == 0 || strcmp(*argv + len - 3, "-gz") == 0) len -= 3; else if (strcmp(*argv + len - 2, ".z") == 0 || strcmp(*argv + len - 2, "-z") == 0 || strcmp(*argv + len - 2, "_z") == 0 || strcmp(*argv + len - 2, ".Z") == 0) len -= 2; else { fprintf(stderr, "gun error: no gz type on %s--skipping\n", *argv); continue; } outname = malloc(len + 1);


左右滑动查看完整内容

if (outname == NULL) { fprintf(stderr, "gun out of memory error--aborting\n"); ret = 1; break; } memcpy(outname, *argv, len); outname[len] = 0; } ret = gunzip(&strm, *argv, outname, test); if (outname != NULL) free(outname); if (ret) break; } while (argv++, --argc); else ret = gunzip(&strm, NULL, NULL, test);  /* clean up */ inflateBackEnd(&strm); return ret;}ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-yocto/layers/meta-myir-remi/recipes-demos/hello/hello$


4

单独编译

ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-yocto/build-remi-1g$ bitbake-v hello



5

解决错误

~/renesas/yocto/myir-renesas-yocto/layers/meta-myir-

remi/recipes-demos/hello/

ubuntu@ubuntu2004:~/renesas/yocto/myir-renesas-

yocto/layers/meta-myir-remi/recipes-demos/hello$ vi hello.bb



需要产品及方案支持

请扫码登记


需要技术支持?

如您在使用瑞萨MCU/MPU产品中有任何问题,可识别下方二维码或复制网址到浏览器中打开,进入瑞萨技术论坛寻找答案或获取在线技术支持。

https://community-ja.renesas.com/zh/forums-groups/mcu-mpu/



未完待续


推荐阅读

烧写更新系统——RZ MPU工业控制教程连载(59)

使用工具链开发应用——RZ MPU工业控制教程连载(60)

bitbake使用——RZ MPU工业控制教程连载(61)

更多精彩,敬请关注

需要产品及方案支持

请扫码登记

评论 (0)
  • 在制造业或任何高度依赖产品质量的行业里,QA(质量保证)经理和QC(质量控制)经理,几乎是最容易被外界混淆的一对角色。两者的分工虽清晰,但职责和目标往往高度交叉。因此,当我们谈到“谁更有可能升任质量总监”时,这并不是一个简单的职位比较问题,而更像是对两种思维方式、职业路径和管理视角的深度考察。QC经理,问题终结者QC经理的世界,是充满数据、样本和判定标准的世界。他们是产品出厂前的最后一道防线,手里握着的是批次报告、不合格品记录、纠正措施流程……QC经理更像是一位“问题终结者”,目标是把不合格扼杀
    优思学院 2025-04-14 12:09 56浏览
  • 在当今汽车电子化和智能化快速发展的时代,车规级电子元器件的质量直接关系到汽车安全性能。三星作为全球领先的电子元器件制造商,其车规电容备受青睐。然而,选择一个靠谱的三星车规电容代理商至关重要。本文以行业领军企业北京贞光科技有限公司为例,深入剖析如何选择优质代理商。选择靠谱代理商的关键标准1. 授权资质与行业地位选择三星车规电容代理商首先要验证其授权资质及行业地位。北京贞光科技作为中国电子元器件行业的领军者,长期走在行业前沿,拥有完备的授权资质。公司专注于市场分销和整体布局,在电子元器件领域建立了卓
    贞光科技 2025-04-14 16:18 95浏览
  • 你知道精益管理中的“看板”真正的意思吗?在很多人眼中,它不过是车间墙上的一块卡片、一张单子,甚至只是个用来控制物料的工具。但如果你读过大野耐一的《丰田生产方式》,你就会发现,看板的意义远不止于此。它其实是丰田精益思想的核心之一,是让工厂动起来的“神经系统”。这篇文章,我们就带你一起从这本书出发,重新认识“看板”的深层含义。一、使“看板”和台车结合使用  所谓“看板”就是指纸卡片。“看板”的重要作用之一,就是连接生产现场上道工序和下道工序的信息工具。  “看板”是“准时化”生产的重要手段,它总是要
    优思学院 2025-04-14 15:02 83浏览
  • 时源芯微 专业EMC解决方案提供商  为EMC创造可能(适用于高频时钟电路,提升EMC性能与信号稳定性)一、设计目标抑制电源噪声:阻断高频干扰(如DC-DC开关噪声)传入晶振电源。降低时钟抖动:确保晶振输出信号纯净,减少相位噪声。通过EMC测试:减少晶振谐波辐射(如30MHz~1GHz频段)。二、滤波电路架构典型拓扑:电源输入 → 磁珠(FB) → 大电容(C1) + 高频电容(C2) → 晶振VDD1. 磁珠(Ferrite Bead)选型阻抗特性:在目标频段(如100MHz~1GH
    时源芯微 2025-04-14 14:53 58浏览
  •  亥姆霍兹线圈的制造材料选择需兼顾导电性、绝缘性、机械强度及磁场性能,具体分类如下:一、‌导线材料1、‌高纯度铜线:‌作为线圈绕制的核心材料,铜因其you异的导电性(电阻率低)和热稳定性成为shou选。漆包铜线通过表面绝缘漆层实现匝间绝缘,避免短路‌。2、‌其他导电材料‌ 铝线等材料可用于特定场景(如轻量化需求),但导电性和抗氧化性较铜略逊二、‌磁源材料‌1、‌永磁体‌如钕铁硼(NdFeB)或铁氧体,适用于无需外部电源的静态磁场生成,但磁场强度有限。2、‌电磁铁‌通过电流控制磁场强度,
    锦正茂科技 2025-04-14 10:22 32浏览
  •   高空 SAR 目标智能成像系统软件:多领域应用的前沿利器   高空 SAR(合成孔径雷达)目标智能成像系统软件,专门针对卫星、无人机等高空平台搭载的 SAR传感器数据,融合人工智能与图像处理技术,打造出的高效目标检测、识别及成像系统。此软件借助智能算法,显著提升 SAR图像分辨率、目标特征提取能力以及实时处理效率,为军事侦察、灾害监测、资源勘探等领域,提供关键技术支撑。   应用案例系统软件供应可以来这里,这个首肌开始是幺伍扒,中间是幺幺叁叁,最后一个是泗柒泗泗,按照数字顺序组合
    华盛恒辉l58ll334744 2025-04-14 16:09 98浏览
  • 一、磁场发生设备‌电磁铁‌:由铁芯和线圈组成,通过调节电流大小可产生3T以下的磁场,广泛应用于工业及实验室场景(如电磁起重机)。‌亥姆霍兹线圈‌:由一对平行共轴线圈组成,可在线圈间产生均匀磁场(几高斯至几百高斯),适用于物理实验中的磁场效应研究。‌螺线管‌:通过螺旋线圈产生长圆柱形均匀磁场,电流与磁场呈线性关系,常用于磁性材料研究及电子束聚焦。‌超导磁体‌:采用超导材料线圈,在低温下可产生3-20T的强磁场,用于核磁共振研究等高精度科研领域。‌多极电磁铁‌:支持四极、六极、八极等多极磁场,适用于
    锦正茂科技 2025-04-14 13:29 53浏览
  • 软瓦格化 RISC-V 处理器集群可加速设计并降低风险作者:John Min John Min是Arteris的客户成功副总裁。他拥有丰富的架构专业知识,能够成功管理可定制和标准处理器在功耗、尺寸和性能方面的设计权衡。他的背景包括利用 ARC、MIPS、x86 和定制媒体处理器来设计 CPU SoC,尤其擅长基于微处理器的 SoC。RISC-V 指令集架构 (ISA) 以其强大的功能、灵活性、低采用成本和开源基础而闻名,正在经历各个细分市场的快速增长。这种多功能 ISA 支持汽车、航空航天、国防
    ArterisIP 2025-04-14 10:52 68浏览
  •   电磁干扰测试系统:电子设备电磁兼容性保障利器   北京华盛恒辉电磁干扰测试系统作为评估电子设备在电磁环境中电磁兼容性(EMC)的关键工具,主要用于检测与分析设备在电磁干扰环境下的性能表现,确保其符合相关标准,能够在实际应用中稳定运行。   应用案例   目前,已有多个电磁干扰测试系统在实际应用中取得了显著成效。例如,北京华盛恒辉和北京五木恒润电磁干扰测试系统。这些成功案例为电磁干扰测试系统的推广和应用提供了有力支持。   系统组成   电磁干扰测试系统一般由以下核心部分构成:  
    华盛恒辉l58ll334744 2025-04-14 10:40 39浏览
  • 亥姆霍兹线圈的应用领域‌物理学研究‌:在原子物理中,用于研究塞曼效应;在磁学研究中,用于测试磁性材料的磁滞回线等特性;还可用于研究电子荷质比等实验‌。‌工程与技术领域‌:用于电子设备校准和测试,提供标准磁场环境;在大型加速器中用于磁场校准;用于电磁干扰模拟实验,测试电子设备在不同磁场干扰下的性能‌。‌生物医学领域‌:研究生物磁场效应,如探索磁场对生物细胞的影响;在生物医学工程基础研究中,提供可控磁场环境‌。‌其他应用‌:作为磁场发生装置产生标准磁场;用于地球磁场的抵消与补偿、地磁环境模拟;还可用
    锦正茂科技 2025-04-14 10:41 51浏览
我要评论
0
0
点击右上角,分享到朋友圈 我知道啦
请使用浏览器分享功能 我知道啦