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

Associate II
November 19, 2025

Hi 

Now im using version 2.0 but get same issue when the project run , got multiple files opening on IDE sometime even i cant find the main file , how to avoid this in new version , anybody knows please help.

Thanks.

Associate II
November 19, 2025

The sad news is that apparently there i no solution to this! Not even with PHD students or professional developers in 2025, we can avoid one file to be opened randomly! Stranagli enough that's the state of the software industry in 2025 and beyond!

 

PHolt.1
Senior
November 19, 2025

Problem is that a lot of people want live variables...

Associate
November 21, 2025

Live variables are live calculations, as I understand it. To write a + b in the field. But if you need it, write the variable c = a + b in the code and view it using standard methods. No problem. Or just printf to the SWV console.

padawan
Senior
November 27, 2025

If you have to workaround a bug, there is still a bug.

And

its a bug not a feature...

padawan

PHolt.1
Senior
November 27, 2025

This BUG is so annoying.

Been doing a lot of editing and ALWAYS it opens start startupxxx.s file. Yes I know there was a hack posted to prevent a specific file opening, but it isn't generally useful because if running in an RTOS environment, Cube always also opens some RTOS file like tasks.c.

The real problem is that if you are doing any keyboard input when this happens, this file(s) obtains focus and receives the keystrokes. You need to carefully close these files, saying NO to the Save? invitation, otherwise you corrupt your project.

STM are leaving this bug in for a reason, absolutely deliberately, but they are not saying WHY.

PHolt.1
Senior
March 2, 2026

That linked workaround works for me.

A bit of a bodge indeed :)

You have to do both steps otherwise you get this popup

It works to stop the startup...s file only however. That file pops up when you do a project build (F11). It does not prevent other files popping up when you do e.g. a restart with 

Those other files are whatever piece of code the CPU was running when the above button was pressed. Mostly it is a particular piece of FreeRTOS code (in my case) and in principle you could do the same "suppression exercise" on that.