CubeIDE debugger locks .elf file before post-build command
- September 2, 2021
- 2 replies
- 1649 views
I have several projects where my workflow relies on the execution of post-build script that manipulate and modify .elf file produced by the compiler.
However, when I try to debug (to be more specific- relaunch already running debug session) such project I get an error as on the attached screenshot- .elf file is being locked and not possible to modify. Even worse that file gets unlocked only if I close CubeIDE.
Steps to reproduce the error:
1. have any project that could be debugged, for example, simple generated skeleton project
2. Add post-build command that modifies the .elf file, could be something simple as 'move' command
cmd.exe /c "move ${ProjName}.elf moved.elf & move moved.elf ${ProjName}.elf"3. Start debug session by pressing "green bug" icon. "Enable auto build" and "Shared ST-Link" options must be checked.
4. Restart debug session by pressing "green bug" icon.
The bug does not happen all the time, but may occur after several dozen tries, which make me think there's a race condition in the debugger, and sometimes it tries to access the elf file before make finished post-build command.
The problem occurs on CubeIDE versions 1.6.0 and 1.7.0, probably earlier versions as well.
Is there any way on current 1.7.0 version to avoid elf files being locked? Terminating debug sessions helps, but extra steps and perspective switches are just too annoying.