cancel
Showing results for 
Search instead for 
Did you mean: 

cannot execute binary file: Exec format error

MQi.1
Senior II

I made a NUCLEO-G474RE IO-Toggle project in eclipse on Ubuntu, the building has been passed through, while I couldn't run it into the NUCLEO board. When I start to debug it, this error was shown:

/bin/bash: /home/mq/eclipse-workspace/test_NUCLEO-G474RE/Debug/test_NUCLEO-G474RE.elf: cannot execute binary file: Exec format error

/bin/bash: /home/mq/eclipse-workspace/test_NUCLEO-G474RE/Debug/test_NUCLEO-G474RE.elf: Success

0693W00000Bd0IlQAJ.png 

I found a similar answer here - https://superuser.com/questions/435988/how-can-i-resolve-the-error-cannot-execute-binary-file

It was said:

Usually that error message means Linux doesn't recognize the file as a shell script or as an executable file.

Typically the cause is running an executable on the wrong architecture - if you try to run x86 executables on an ARM CPU, this message comes up.

Maybe my launch configuration was wrong:

0693W00000Bd0IqQAJ.pngany suggestion?

1 ACCEPTED SOLUTION

Accepted Solutions
MQi.1
Senior II

“Debug�? was the same, I bypass this by STM32CubeProg.

View solution in original post

2 REPLIES 2
Andrew Neil
Evangelist III

"Usually that error message means Linux doesn't recognize the file as a shell script or as an executable file"

Indeed.

It sounds like you're trying to run the STM32 target binary on your Linux Host ?

Rather than a Run configuration, have you tried making a Debug configuration ... ?

0693W00000Bd2HkQAJ.png

MQi.1
Senior II

“Debug�? was the same, I bypass this by STM32CubeProg.