Skip to main content
eben .11
Associate II
April 25, 2023
Solved

"No source available for "main() at 0x8001a14" " while debugging

  • April 25, 2023
  • 6 replies
  • 3025 views

I am trying to debug a sample project from st website and but it is stuck in the first line of main (assembly ) meanwhile when I flash the .hex with cube programmer , the project works perfectly. So I assume that it's a problem with the debugger.

I made sure that he's selecting the correct .elf file but still not working

I did respect all the readme steps.


_legacyfs_online_stmicro_images_0693W00000binrpQAA.png

Best answer by eben .11

well I figured that he was working with the release build instead of the the debug build. I still do not know the difference between the two of them but it's working with the debug one

6 replies

Tesla DeLorean
Guru
April 25, 2023

Not really clear on the part or the context, or errors it had when starting the debugger.

Looks like it can't associate source files, so perhaps wrong meta-data in .ELF file.

Is it a part with multi-cores, or some kind of loader application in the front of the Flash?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
eben .11
eben .11AuthorBest answer
Associate II
April 26, 2023

well I figured that he was working with the release build instead of the the debug build. I still do not know the difference between the two of them but it's working with the debug one

Remy ISSALYS
Technical Moderator
April 26, 2023

Hello,

Indeed, you are right, you should use the debug build. The default options available are Debug (a build with debug symbols, and optimizations turned off), and Release (a build with optimizations ON and no debug symbols).

Best Regards

eben .11
eben .11Author
Associate II
April 26, 2023

Thank you all for your time

Rim LANDOLSI
ST Employee
April 26, 2023

Hello @eben .1​  and welcome to the community,

The difference is in the compiler settings. In fact, debug and Release are created by default with the default optimization levels in GCC for the configurations:

  • Debug --> Optimization off -O0
  • Release --> Optimize for size -Os

The Debug configuration makes the project built with debug information and without any optimization. The Release configuration makes the project optimized for smaller code size and with no debug information. By default, the Debug configuration is set as the active build configuration when the project is created.

I wish this answer helps you.

Thanks,

Rim

Visitor II
October 2, 2024

I'm having a similar problem, but in my case the error I get is: No source available for "huart1() at 0x2000003a". I only get this error whenever I use a method that uses UART, such as HAL_UART_Transmit. Could anybody help me solve this please? I am new to this.  

 

Capablanca_1-1727893401540.png