2020-07-19 05:45 AM
Hello,
I'm new to the linux stuff, so i folowed the tutorial : create hello world application to the key.
At the end of:
I try to run the program on the board but i get the 'error: Cannot execute binary file: exec format error' . I don't know if i forget something or something is missing. When i tried to make the file it was missing gtk3 so i install that myself but i couldn't find that anywhere in the tutorial.
Any help would be appreciated.
Thanks in advance 🙂
2020-07-19 06:38 AM
Are you sure you sourced the SDK environment script before running compiling the example code? If you don't do that, it is possible that make built targeting x86 and when you try to run on the ARM processor core in the STM32MP1 it doesn't understand the compiled code.
2020-07-19 06:47 AM
Thank for the reply.
If you mean by sourcing the sdk enviroment:
source SDK/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
I tried re sourcing it, but that didn't help :(
For checking if the enviroment is setup correctly, i checked the following:
echo $ARCH
echo $CROSS_COMPILE
$CC --version
echo $OECORE_SDK_VERSION
and they all give the correct reponses, according to the tutorial.
2020-07-19 08:14 AM
Thanks for the suggestion.
Before i found the command uname and that gave me amd64, so i tried a bunch of stuff.
I restarted my computer and then i suddenly didn't have any premission to edit files.
After fixing that and working through visual studio code it suddenly worked.
Now the command uname says linux.
🙂 thanks
2020-07-19 08:16 AM
One trap you have to watch out for is you can't have the Bitbake environment script (that ships with the developer or distribution packages) sourced with the SDK environment script. You have to use them in separate terminals. I personally use TMUX to keep everything separated yet easily accessible.
Glad you got it working though! Good luck!