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

Gaston_78
Graduate II
April 30, 2025

When I press to Run (Run main.c) button, STM32CubeIDE

OPENS RANDOM TABS FILE and CHANGE FOCUS.
This is happening since last 7 YEARS !!!!! Come on !!!

padawan
Senior
May 26, 2025

In a month's time, the thread will have its 5th birthday.

Will we then receive the gift that the problem has finally been solved?

;)

padawan

AAlis.23
Associate III
May 27, 2025

It’s genuinely astonishing that nobody talks about this. We’re in 2025, and ST is still using an Eclipse-based IDE with a fundamental, persistent issue that makes daily work unnecessarily frustrating. This isn’t some niche problem, it’s basic, and yet it’s still there after all these years.

To me, this says a lot about the state of software development today. The industry is flooded with developers who are mediocre at best. I wouldn’t be surprised if this bug has been handed off to someone who has no clue how to fix it. Anything beyond adjusting fonts or colors in a settings panel seems to be too much for many nowadays.

It’s disappointing, especially coming from a company like ST. This should have been resolved long ago, and the ongoing silence around it is just as frustrating as the bug itself.

ferro
Lead
May 27, 2025

Hi @AAlis.23 

Very interesting. I’m not sure if I have the same issue and it’s just below my threshold of annoyance.

Could you possibly screen record what the issue looks like so I can better understand?

Thanks.

Lukasz Nowak
Associate III
May 27, 2025
padawan
Senior
May 27, 2025

Hi ferro 

i copied that form  this thread at the beginning from Jenny Kenny ‎2021-12-02 12:48 AM at Page 1

There you see your "video" . That whats happend all the time and over years.

So we are all a "little" aannoyed.

padawan

 

 

padawan_0-1748348836417.gif

 

ferro
Lead
May 27, 2025

Thanks @padawan 

I had watched the video for maybe a minute, waiting for it to stop, only to realize it was running in a loop.

But this was solved already i think. I'll try to find the post with answer. Hm. Very sad.

Or more correctly, the change I did in CubeIDE setup stopped that from happening.

padawan
Senior
May 27, 2025

Hi ferro,

at https://wiki.st.com/stm32mcu/wiki/STM32CubeIDE:STM32CubeIDE_errata_1.18.x

at

ID 162500
After programming a device in Run mode, STM32CubeIDE opens every time a new tab with startup file and give focus on that tab.

and the errata is worng: its not only a/the startup file. The files are random, like .c or .s or others.  

So it is not solved!

padawan

 

 

PHolt.1
Senior
May 27, 2025

I don't think it is a totally random file. The file opened is one which contained code that was running when the debugger stopped the CPU.

If running under an RTOS then stuff opens all over the place because loads of tasks are running under it.

ferro
Lead
May 28, 2025

I think guys here are having problem with beginning of a debug session. What you are describing is pausing debug already running.

padawan
Senior
May 28, 2025

No i end the debugseesion  by hittung the red square.

padawan_0-1748437065301.png

If i edit a file, compile and hit debug again (F11)

 

padawan_2-1748437167849.png

it jumps

padawan

 

Lead II
May 27, 2025

It shouldn't be a complicated thing. There is a thread that controls the debug session with the device and there is a GUI thread controlling the IDE. Somehow these are not communicating properly. It leads the IDE thinking the debug session has started, when it hasn't (play/pause button clickable too soon) and the IDE using an invalid stack pointer value to jump to random code. Perhaps initializing the stack pointer in this code with NULL and only jumping to a file once it contains a valid value or something might fix it.
What information is exchanged between the debugger and the IDE? When there is a breakpoint it communicate an address. When halting it reads various registers and memory regions. Live values are probably more complicated, but we can leave that out of the scope for this problem. I guess the number of events communicated isn't that much. We just have to pinpoint where it all goes wrong.
How can we debug STM32CubeIDE itself? Do we have to build it from source? Is there source available? Do we have to debug the GBD driver too? I don't know where to start. But if someone can give a hint I might try to look into it.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
ferro
Lead
May 27, 2025

Hi @unsigned_char_array 

@padawan  etc.

I just thought about buying a development kit that we all agree on (maybe an H7, around £60), sharing a single project, and comparing the results and settings. It would be better to have sth tangible.

What do you think ?

Lead II
May 27, 2025

@ferro wrote:

Hi @unsigned_char_array 

@padawan  etc.

I just thought about buying a development kit that we all agree on (maybe an H7, around £60), sharing a single project, and comparing the results and settings. It would be better to have sth tangible.

What do you think ?


I have an STM32H735G-DK development board. If you get the same it would be the same one or another one for the H7 I could replicate what you make. But I don't think the exact target hardware is important. I could be wrong.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
Graduate
May 28, 2025

FWIW, our dev team works with many different types of STM32 cpu's like the G0b1, F746, F412, F413, H7, etc. , different IDE versions and application types and it happens in all cases.

@char[] and @FE, cool that you are going to put this to a real test. I hope it contributes to some more insight in the exact behaviour.

ferro
Lead
May 28, 2025

Hm, very interesting, @AAlis.23 says the same.

1. What ST Links is your team using - I've got STLINK-V3SET, bought few months ago.

2. And this random jump is with no braeakpoint set ? If yes, what happens if you set BP at main () ?

Lead II
May 28, 2025

@ferro wrote:

Hm, very interesting, @AAlis.23 says the same.

1. What ST Links is your team using - I've got STLINK-V3SET, bought few months ago.

2. And this random jump is with no braeakpoint set ? If yes, what happens if you set BP at main () ?


I have the STLINK-V3SET too. Some dev kits have build-in debuggers. Such as the STM32H735G-DK. In that case you just need a USB-cable.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
padawan
Senior
May 28, 2025

This points to the an other adress.

We are talking about the .s file in your screenshot on the right.

my setting 

padawan_0-1748433661194.png

and it jumps.....

padawan

 

Lead II
May 28, 2025

This solution only prevents non-existent source files from being opened. The s-file or some other files do open frequently.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
padawan
Senior
May 28, 2025

Hello unsigned_char_array

yes i know. 

this was/should be a reply for ferro, to show him, that his solution have nothing,

to do with the bug, we are talking about over 5 years. 

padawan

Graduate II
May 28, 2025

Seems like we have a troll here.

Anyways, unsubscribing from notifications, I'll just have to live with this bug. Good luck guys.

AAlis.23
Associate III
May 29, 2025

This post is starting to feel like a series... every day I’m just here waiting for the next episode of The Last of Us. Hoping one day we get a happy ending.

ferro
Lead
May 29, 2025

haha, it does doesn't it..embedded is a jungle..but we'll get there, its all fun