Skip to main content
Visitor II
July 19, 2020
Question

STM32MP157DK2 Hello world application error: Exec format error

  • July 19, 2020
  • 2 replies
  • 1688 views

Hello,

I'm new to the linux stuff, so i folowed the tutorial : create hello world application to the key.

At the end of:

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-A7/Create_a_simple_hello-world_application

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 :)

    This topic has been closed for replies.

    2 replies

    Visitor II
    July 19, 2020

    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.

    ATuinAuthor
    Visitor II
    July 19, 2020

    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.

    Visitor II
    July 19, 2020

    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!