cancel
Showing results for 
Search instead for 
Did you mean: 

Jumping to random file after pressing Run button

GeneralTao
Associate II

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.

217 REPLIES 217

Cube IDE is about 7 years old !!

It's the birthday of this bug-threat ;)

padawan

Haha, thanks!


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

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'

>>"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.

mtmk
Associate

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.

vaualbus
Associate II

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 III

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.