硬件:imx8qxpC0-mek
软件:起初使用的l4.14.98_2.0.0的yocto编译出的rootfs.sdcard烧写到SD卡上,后来用l4.14.98_2.3.0:uboot,scfw,atf,kernel-image都是统一版本编译的并替换掉原来的flash.bin和image&dtb
hello.c:
#include<stdio.h>
int main(){
printf("hello world\n");
return 0;
}
在PC机上使用source environment-setup-aarch64-poky-linux重置环境变量之后,使用$CC hello.c -o hello_world
将hello_world拷贝到开发板的/home/目录下,chmod a+x hello_world
运行:./hello_world
无任何打印信息
使用gdb hello_world
"/home/hello_world": not in executable format: File truncated
想问一下这种问题如何解决?
For hello world on i.MX you can refer to this IMX Hello World - Variscite Wiki