Skip to main content
Senior II
August 7, 2024
Question

when debugging i get Launch Terminated: "ELF file does not contain any .text section."

  • August 7, 2024
  • 2 replies
  • 2491 views

The past few days I have encountered erratic behavior where this message often appears when trying to debug a board:

"
Launch Terminated:

The ELF file does not contain any .text section. Either manually enter the offset for the ELF file in the launch configuration or disable symbol loading for the ELF file.
"

It's strange that I can't find any information about this on the internet or this forum. This is a serious problem that prevents me from debugging further. I did not change any compiler, linker or build configuration settings and am hesitant to download the newer IDE version due to a watch bug where I can't reliably see variable values.

What can I do to solve this?
Thank you.

i use 

Version: 1.13.2

Build: 18220_20230914_1601 (UTC)

 

2 replies

Andrew Neil
Super User
August 7, 2024

So it thinks your ELF file has no code in it!

Did you successfully build before trying to debug?

 

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.
sde c.1Author
Senior II
August 7, 2024

Building is no problem, no error or warnings. It fails once i press the debug button that makes contact with ST-LINK/V2

Andrew Neil
Super User
August 7, 2024

Have you tried a Clean & rebuild?

can you debug any other projects?

Is your Debug Config pointing to the correct ELF file?

 

Added:

What does the linker listing ("map file") show?

Are you using a custom linker script?

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.
sde c.1Author
Senior II
August 21, 2024

Deleting the debug configuration and creating a new one seems to solve the issue in another project. I believe it has something to do with renaming the project, though I can't pinpoint the exact cause. The STM32CubeIDE software engineers could consider automatically deleting any configurations after renaming the project to prevent this error.