Skip to main content
Visitor
August 25, 2026
Question

St-link debugging launch to main failed

  • August 25, 2026
  • 2 replies
  • 20 views

I am running into a frustrating issue while trying to debug my project. Whenever I start a debugging session, the debugger fails to hit or start from the main () function. 

I have already double-checked and configured the settings under Tools > Options > Debugger [adjust path if necessary], but the issue persists. Because of this, it's extremely difficult to step through the code and understand the execution flow from the beginning. 
Environment Details 

  • IDE / Version: IAR EW 9.20.2 

  • Language: C/C++ touch GFX framework is there  

  • Operating System: Windows 

  • STM32H750IBTx 

What I've Tried 

  1. Checked and re-configured the debugger paths under Tools > Options > Debugger. 

  2. Cleaned and rebuilt the solution/project. 

  3. Kept breakpoint one the very first line of code after main () 

Error Message / Behavior 

  • The execution does not stop in main () entirely or throws a symbol loading error. 

     

     

2 replies

cartergray733
Explorer
August 25, 2026

Check that the correct ELF/OUT file and debug configuration are being used, and disable optimization for the debug build. Also verify that symbols are loaded correctly and that the MCU startup code reaches main(). A breakpoint in the reset/startup code can help confirm where execution stops.

Ozone
Principal
August 25, 2026

There is quite a bit happening before an application reaches main().
Have you tried to set a breakpoint at the reset vector entry ?
In some IDEs, this amounts to unmark a “Run to main” setting for the debugger.