Skip to main content
MQi.1
Senior II
July 7, 2021
Solved

cannot execute binary file: Exec format error

  • July 7, 2021
  • 2 replies
  • 27527 views

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?

This topic has been closed for replies.
Best answer by MQi.1

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

2 replies

Andrew Neil
Super User
July 7, 2021

"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

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
MQi.1
MQi.1AuthorBest answer
Senior II
July 9, 2021

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