之前一直是用ubuntu16及18,瑞萨官方给推荐用的开 发环境是ubuntu20,算是比较新的环境了。花了两晚上的时间总算把环境弄好了。接下来就是开发了,摄像头部分看能否复用公司项目上的,其他再找找家里有没有合适的项目剩下的物料。开篇来个熟悉下环境及板子。
根据《软件开发指南》来就可以了。耐心等待安装完成即可。相比于齐感或全志,搭建米尔的sdk还是挺简单的,不需要通过gitlib来下载,直接使用现成的批处理文件即可。
执行cc -v
,可以看到编译器的版本信息
source /opt/poky/3.1.20/environment-setup-aarch64-poky-linux
执行$CC hello.c -o hello
,后,file下,可以看到编译后的文件属性为:
hello: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-aarch64.so.1, for GNU/Linux 3.14.0, BuildID[sha1]=a928b0617a1489f13513232c05d84dd99b26ae77, with debug_info, not stripped
这步还是需要些时间的,本来看着也就几百M,实际解压出来,需要大量的时间。
执行DISTRO=poky MACHINE=myir-yg2lx source layers/meta-myir-yg2lx/scripts/myir-environment.sh build-myir
,自动会进入build-myir目录。
直接在build-myir目录下执行bitbake myir-image-full -k
,实际此步是执行不下去的,会遇到错误,仔细看了下手册,是需要解压Yocto-qt-downloads.tar.bz2,但这个文件在哪里呢???
实际报错如下:
guangod@guangod-virtual-machine:~/myir-renesas-yocto/build-myir/tmp$ bitbake myir-image-full
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Fetcher failure for URL: 'https://yoctoproject.org/connectivity.html'. URL https://yoctoproject.org/connectivity.html doesn't work.
Please ensure your host's network is configured correctly.
If your ISP or network is blocking the above URL,
try with another domain name, for example by setting:
CONNECTIVITY_CHECK_URIS = "https://www.example.com/" You could also set BB_NO_NETWORK = "1" to disable network
access if all required sources are on local disk.
并且,通过串口烧写要借助官方提供的tera term 工具。
需要注意的是:输入XLS2等命令后,不用按y键,自动进入设置状态,这点是与手册不同的地方,其他按手册操作基本不会出什么问题。
还是遇到些问题的,如下图所示:
[ 2.812907] Call trace:
[ 2.815803] RTW: bDescriptorType=5
[ 2.821350] dump_backtrace+0x0/0x1b0
[ 2.821357] show_stack+0x18/0x68
[ 2.823815] RTW: bEndpointAddress=5
[ 2.831439] dump_stack+0xd8/0x134
[ 2.831444] panic+0x174/0x33c
[ 2.831454] mount_block_root+0x238/0x254
[ 2.840944] RTW: wMaxPacketSize=512
[ 2.844710] mount_root+0x10c/0x13c
[ 2.844718] prepare_namespace+0x12c/0x16c
[ 2.853641] RTW: bInterval=0
[ 2.861358] kernel_init_freeable+0x25c/0x29c
[ 2.861367] kernel_init+0x14/0x114
[ 2.865000] RTW: RT_usb_endpoint_is_bulk_out = 5
[ 2.869614] ret_from_fork+0x10/0x34
[ 2.869620] SMP: stopping secondary CPUs
[ 2.874518] RTW:
[ 2.874518] usb_endpoint_descriptor(2):
[ 2.879022] Kernel Offset: disabled
[ 2.879026] CPU features: 0x0240026,2800a238
[ 2.879029] Memory Limit: none
[ 2.965696] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2) ]---
只要出现这个问题,就不能输入了,弄齐感芯片,也遇到过一样的问题,是不是一样的解决方法呢?有待验证。
弄这些,也差不多费了一天+晚上11点多的时间了,可见,搞linux就是折腾,还真不是会不会的问题,尤其是应用层的编程,就那些东西。关键的还是把底层的一些问题解决掉,上层就好编程些。也许也是第一次接触瑞萨的soc,太不熟练了吧。