cancel
Showing results for 
Search instead for 
Did you mean: 

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

sde c.1
Senior II

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)

 

6 REPLIES 6

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.

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

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.

I tried Clean & rebuild before with no success, i can debug other projects, correct ELF file was used in Debug Config.

After Clean & rebuild this time it started working again. Thats why i said erratic behavior ...
I will follow this up in the future and post a solution once i got a clue whats going on..

Good that it's working again for now ... :thumbs_up:

Might be worth saving your working ELF & map files for comparison if this happens again.

Also try feeding the ELF into objdump and see what that makes of it ...

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.1
Senior II

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.