cancel
Showing results for 
Search instead for 
Did you mean: 

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

WKhan.2
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

5 REPLIES 5
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
WKhan.2
Associate II

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.

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

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
Up vote any posts that you find helpful, it shows what's working..
WKhan.2
Associate II

Thanks for the help, the issue was resolved.