Skip to main content
GeneralTao
Associate II
June 25, 2020
Question

Jumping to random file after pressing Run button

  • June 25, 2020
  • 105 replies
  • 56096 views

Hello. When I press to Run (Run main.c) button, STM32CubeIDE opens random file, possibly, from current repository, for example: startup_stm32l452xx.s, core_cm4.h etc...

Code is loading successful, but this side effect bothers me.

I would like to disable this function. How can I do it?

If you need more information about this behavior please, ask.

Thank you for reading.

105 replies

ferro
Lead
May 30, 2025

Try untick the 'Enable live expressions'

This prevented opening the startup_stm32xxx.s.

 

ferro_0-1748625114100.png

 

AAlis.23
Associate III
May 30, 2025

Sorry, but it doesn't work. Tested, the startup file still opens.

ferro
Lead
May 30, 2025

Thanks for checking. I can control opening startup with that option.

Second option I can force startup to (not) open is this

Untick [Set breakpoint at]

ferro_0-1748629506689.png

 

AAlis.23
Associate III
May 30, 2025

Sorry, but no, close but not quite. The issue isn't that it sets an automatic breakpoint in main if you've selected that in the startup configuration, the problem is setting any breakpoint. That is, if you have no breakpoints set and don't have that option enabled, there's no issue. But if you set even a single breakpoint anywhere or enable that startup configuration one, then the startup.s file opens automatically.

ferro
Lead
May 30, 2025

Hm, but I set BP at HAL_Init ()

ferro_0-1748637208617.png

 

"Sorry, but no, close but not quite."

Yes, and i take break from this. Some combo of Debug config settings?. Hm.

 

AAlis.23
Associate III
May 30, 2025

I know you'll make it in the end!!! I'll vote for them to make you ST's CTO haha

PHolt.1
Senior
June 2, 2025

ST are dumping Cube IDE and moving to VS so Cube is not going to get any fixes now anyway.

https://www.eevblog.com/forum/microcontrollers/is-st-cube-ide-a-piece-of-buggy-***/msg5933652/#msg5933652

ferro
Lead
June 2, 2025

Hi @PHolt.1 

Did you want to point to a specific msg from that thread ? Because I see this when I click the link

ferro_0-1748873190226.png

 

PHolt.1
Senior
June 2, 2025

Go the the end. The problem is that this forum truncates long URLs...

ferro
Lead
June 2, 2025

Thanks

"During this transition period, STM32CubeIDE will be maintained. Currently, STM32CubeIDE is the best debugger for STM32 microcontrollers and can be used side-by-side with VS Code."

Luckily, I have no issues with STM32CubeIDE so I agree with "STM32CubeIDE is the best debugger for STM32 microcontrollers".

Gaston_78
Graduate II
June 3, 2025

Write whatever you want @ferro , but it simply happens! .. this thread is not fake!. I am facing this problem since las 5 years using all versions IDE and reinstalling  CUBE in different Computers and windows versions.

ferro
Lead
June 3, 2025

"Write whatever you want @ferro but it simply happens"

Haha, where do i say it does not. Oh dear,I know 5y is a long time but Calm down guys, we will get there.

So there is 3 of you so far. We know why startup.s so that is semi-sorted, not 'a random file'. Now focus on files after end of debug session. Prolly sth similar.

PHolt.1
Senior
June 26, 2025

That's right; it is not a random file. It is the file whose code was executing when the program starts or when you hit a breakpoint, etc.

I've just been debugging all day for a week and every time I do a debug build (F11) I get the startup.s file opening. This is riduculous and cannot be disabled, yet should be easy to fix.

There used to be an option for an automatic halt on main() but it has been removed, and anyway it doesn't stop there now.

ST have abandoned Cube IDE development anyway, according to a recent press release.

 

padawan
Senior
June 26, 2025

Congratulations on your 5th birthday, dear bug.

May you be solved one day.....

padawan

ferro
Lead
June 26, 2025

Haha, thanks!


I wanted to post exactly that, but I guess it wouldn’t be considered PC.
We should organize a team-building meetup. 'Coalition Of the Willing'

Explorer II
September 1, 2025

Not sure if it's been mentioned previously (this is a very long thread), but I've had luck with disabling debug symbols for specific sources I don't want randomly opening.

1. Right click on unwanted file(s) in the Project Explorer. Choose the Properties item at the bottom.

mtmk_1-1756719590470.png

 

2. Go to C/C++ Build >> Settings. Change Debug level to None.

mtmk_2-1756719728172.png

 

3. If you get warnings about missing sources or symbols, you can disable those too as suggested by configuring the behavior for missing sources (Window >> Preferences >> C/C++ >> Debug >> Source Not Found).

mtmk_3-1756720653350.png

 

It's a bandage fix that doesn't solve the root problem, but it's good enough for me at least.

Hope this helps someone.

Associate
November 10, 2025

I managed to strengthen your bandage :)
1. Uncheck the “Enable live expressions” checkbox in the debugger settings in the debug window (Run >> Debugger Configuration >> Debugger >> Misc). This checkbox was causing random windows to open. If you uncheck it, only one file will open, which we will disable below.
2. Disable debug information for Startup/startup_*.s as shown above.
3. Disable warnings about missing sources or symbols as shown above.

Explorer
November 11, 2025

It's working! :D

Associate II
September 2, 2025

This bug annoys me the most and it's impressive that still is not solved.

But maybe to alleviate it you could disable modification to files until you the breakpoint at main is not hit. It happens a lot of the time that I think to modify the main file after pressing the run button, but I write random chars in the random opened file.

 

As I side note, if as many STMCubeIDE is the best debugger how bad are the others? Because common guys why you do not save settings like show my f***k numbers in hex format and every time I had to change back to hex view. :)

PHolt.1
Senior
September 2, 2025

Some fairly obvious ways to solve this have been posted, many months ago. Basically the code should qualify the file opening until some conditions have been met.

For some reason ST are unwilling to fix it.

Yes it is dangerous behaviour because the newly opened files have focus and will thus be absorbing keystrokes intended for elsewhere.

Associate
October 28, 2025

I just come here to play my part pushing the solve of this bug which is really annoying (and old, can't wait to seen it go to college and pass its driving licence).

Good luck everyone !