2020-06-25 6:27 AM
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.
2025-06-26 12:25 AM
Cube IDE is about 7 years old !!
2025-06-26 12:36 AM
It's the birthday of this bug-threat ;)
padawan
2025-06-26 1:17 AM
Haha, thanks!
I wanted to post exactly that, but I guess it wouldn’t be considered PC.
We should organize a team-building meetup.
2025-06-26 1:19 AM - edited 2025-06-26 1:30 AM
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'
2025-06-26 1:26 AM - edited 2025-06-26 1:26 AM
>>"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."
Thanks for stating that.
And the 'random' file that opens when terminating the debug session is actually the file containing the code currently being executed by the CPU, as reported to GDB at the moment 'Stop' is pressed. A similar behavior occurs when you press 'Pause' or 'Suspend' - a 'random' file opens then as well.
2025-09-01 3:09 AM
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.
2. Go to C/C++ Build >> Settings. Change Debug level to None.
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).
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.
2025-09-02 7:14 AM
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. :)
2025-09-02 7:19 AM - edited 2025-09-02 7:20 AM
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.