Skip to main content
Visitor
August 25, 2026
Question

St-link debugging launch to main failed

  • August 25, 2026
  • 5 replies
  • 80 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. 

     

     

5 replies

cartergray733
Explorer II
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.

EXUE.2
ST Employee
August 26, 2026

if it is caused by a insufficient heap/stack size? you can expand it in .icf file and try it again.

Pavel A.
August 26, 2026

The debugger complains about some warnings after reset and unable to go to main.

IAR support should be able to help with this.

Make sure to specify the correct STM32 MCU model in the project settings. IIRC the IAR debugger is very picky about this.

 

Ozone
Principal
August 26, 2026

Looking closer at the screenshot, there seems external SDRAM involved.
Not sure how the debugger handles this.
Asking IAR would be a good option, I think.