Skip to main content
WKhan.2
Associate III
May 26, 2021
Solved

How to solve the error "No source available for main() at ..." encountered while debugging ?

Hi everyone,

I have been trying to debug my project, the moment I select the debug option, the window appears which shows the message "No source available for main() at ---- "

What does this mean? How to reolve this issue?

Looking forward to the help.

Thanks in advance.

BR

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
May 27, 2021

What address is it reporting? Present failure context better, perhaps with a screen shot, or more complete diagnostic output.

It is possible to build objects/executables which lack debug info, or file/line level address attribution.

Perhaps to a listing/disassembly and find the offending code/context from that.

If 0x1FFFxxxx type address, it would suggest BOOT0 in High/Floating and ROM execution is occurring.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

5 replies

ST Technical Moderator
May 27, 2021

Hello @WKhan.2​ ,

Can you please provide more details on your environment used in order to analyze this issue and help you.

Which device are you using? Which software release used ?

What do you expect exaclty as project?

Are you using a particular Cube example? If yes, which one?

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
WKhan.2
WKhan.2Author
Associate III
May 27, 2021

Hi @Imen DAHMEN​ , thanks for the reply.

I have been using STM32CubeIDE for developing and debugging the project.

The device I am using is embedded STM32L452RE with release of STM32CubeIDE is 1.6.0.

I am debugging it with ST-Link.

I am not running the Cube example, I am developing a firmware having different included libraries.

My expectation is that when we run the Cube example or write the simple code in main.c on normal evaluation baord and start debugging it debugs normally, it should also work like that.

ST Technical Moderator
May 27, 2021

Hi @WKhan.2​ ,

You should check your debug configuration settings (Optimization Level, and Debug Level). For that, I advise you to check this post it may help you.

Also, have a look at this article in the debug section: How to make sure the STM32 starts properly in our design?

Please keep us updated about your progress on this issue.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
May 27, 2021

What address is it reporting? Present failure context better, perhaps with a screen shot, or more complete diagnostic output.

It is possible to build objects/executables which lack debug info, or file/line level address attribution.

Perhaps to a listing/disassembly and find the offending code/context from that.

If 0x1FFFxxxx type address, it would suggest BOOT0 in High/Floating and ROM execution is occurring.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
WKhan.2
WKhan.2Author
Associate III
October 27, 2021

Thanks for the help, the issue was resolved.