2022-01-24 08:06 AM
I use STM32CubeIDE and every time, when I use Run configuration to build and flash MCU, IDE opens startup_stm32<mcu>.s file (startup_stm32g431kbtx.s for example).
Project has been generated by STM32CubeMX.
Settings in Run configuration are default.
How to disable that behavour?
Solved! Go to Solution.
2022-03-01 08:03 AM
This is actually expected when you use ST-LINK GDB server.
In the launch sequence we do the following:
The issue you observe happens somewhere inside step 3-5 above. It is the Eclipse framework which is notified that we actually have a debug session running. The framework will then try to suspend the CPU and fetch the current PC to update the editor with which line we are currently executing. Whether this Eclipse debug event update will happen or not is timing sensitive which is why it may be hard to re-produce. Maybe more likely to happen when we have to process a larger image file during step 5.
I don't think we have a work-around for this. We use the Eclipse/CDT debug launch mechanism in a way it was not originally designed for, and this is the penalty. I doubt this is something we can fix.
But as always, the more complaints we get, the higher priority to fix. But our position is that we have more painful defects to attend than this one. :)
2022-01-24 04:22 PM
FWIW, I can't replicate this behavior on a new F4 project. Not sure why it would be opening that file unless you're debugging.
2022-01-24 11:41 PM
I added video with this case.
2022-01-25 04:14 AM
I solved that by reinstall IDE (Ubuntu) and re-generate project by IDE, not from CubeMX.
2022-01-25 05:14 AM
Hello there,
So just for clarification, if you are using CubeIDE with Ubuntu and generated the project through CubeMX and import it into CubeIDE you run into this problem?
But if you create the project from CubeIDE directly this problem does not appear?
2022-01-26 12:09 AM
Now that bahaviour appears again.
Some time it works perfectly. But after some dubug-session, IDE began opens randomly stm32xxx_hal.c, startup_stm32xxx.s. And it highlights for a some momens randomly any line, like breakpoint or start of session.
I think, IDE try to run some debug-features when I use Run configuration.
2022-01-26 06:17 AM
How was your project and run configuration generated?
2022-01-26 06:54 AM
Project generated by STM32CubeIDE, C++, selected one nucleo board.
Run configuration generated by adding it in Run Configurations with options on screenshots below.
2022-03-01 08:03 AM
This is actually expected when you use ST-LINK GDB server.
In the launch sequence we do the following:
The issue you observe happens somewhere inside step 3-5 above. It is the Eclipse framework which is notified that we actually have a debug session running. The framework will then try to suspend the CPU and fetch the current PC to update the editor with which line we are currently executing. Whether this Eclipse debug event update will happen or not is timing sensitive which is why it may be hard to re-produce. Maybe more likely to happen when we have to process a larger image file during step 5.
I don't think we have a work-around for this. We use the Eclipse/CDT debug launch mechanism in a way it was not originally designed for, and this is the penalty. I doubt this is something we can fix.
But as always, the more complaints we get, the higher priority to fix. But our position is that we have more painful defects to attend than this one. :)
2023-07-22 06:42 PM
Absolutely a low priority - but it catches me every time :)
My muscle memory anticipates the debugger pausing at the start of main() and I usually automatically hit F5 to continue (I don't want to disable this because sometimes I need it to stop there)
My eyes see the pause in the startup.s file and my finger automagically hits F5 which, of course, then tries to start another session and causes the debugger to bail out.
For completeness, my project is written using just CMSIS so this has nothing to do with the Cube code generation.
The insidious aspect is that, as stated, this seems to be timing-related and doesn't happen every time - I have to watch more carefully now. Life is so unkind to engineers sometimes ;)