Hello,
I tried to run a hello world application on the target but i got the following “cannot execute binary file: Exec format error”.
Commands on the host:
user@pc:~/yocto/workspace/tdx-dunfell/sdk$ uname -a
Linux PC 5.4.0-147-generic #164~18.04.1-Ubuntu SMP Tue Apr 4 00:20:20 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
user@pc:~/yocto/workspace/tdx-dunfell/sdk$ source environment-setup-armv7at2hf-neon-tdx-linux-gnueabi
user@pc:~/yocto/workspace/tdx-dunfell/sdk$ echo ${CC}
arm-tdx-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/pc/yocto/workspace/tdx-dunfell/sdk/sysroots/armv7at2hf-neon-tdx-linux-gnueabi
user@pc:~/yocto/workspace/tdx-dunfell/sdk$ echo ${CFLAGS}
-O2 -pipe -g -feliminate-unused-debug-types
user@pc:~/yocto/workspace/tdx-dunfell/sdk$ cd /home/pc/vsc-workspace/c/hello
user@pc:~/vsc-workspace/c/hello$ ${CC} ${CFLAGS} -c hello.c -o hello
user@pc:~/vsc-workspace/c/hello$ file hello
hello: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), with debug_info, not stripped
user@pc:~/vsc-workspace/c/hello$ scp hello root@192.168.1.21:
hello 100% 5424 924.6KB/s 00:00
Commands on the target:
root@apalis-tk1-03129001:~# uname -a
Linux apalis-tk1-03129001 5.4.193-rt74-5.7.1-devel+git.f5d73fd6e9f8 #1 SMP PREEx
root@apalis-tk1-03129001:~# ls -lh
-rw-r--r-- 1 root root 5.3K Sep 20 10:57 hello
root@apalis-tk1-03129001:~# chmod +x hello
root@apalis-tk1-03129001:~# ./hello
-sh: ./hello: cannot execute binary file: Exec format error
root@apalis-tk1-03129001:~# strace ./hello
execve("./hello", ["./hello"], 0xbedc0d30 /* 21 vars */) = -1 ENOEXEC (Exec for)
strace: exec: Exec format error
+++ exited with 1 +++
Host: Linux MYPC 5.4.0-146-generic #163~18.04.1-Ubuntu SMP Mon Mar 20 15:02:59 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Target Som: Apalis TK1
Target Carrier: Ixora Carrier Board V1.1
Target Kernel: 5.4.193-rt74-5.7.1-devel+git.f5d73fd6e9f8