2024-09-13 07:07 AM - last edited on 2024-09-13 07:35 AM by SofLit
Hi,
is any possibility to protect editing code generated with in STM32Cube. I sometimes made some mistake and change the generated code. It would by good, if it is in STMCube some toggle button, that I can enable disable editing the the code generated with STMCube. The user code would be editable every time.
The best solution would be if the not editable text code will be sad or grey.
Solved! Go to Solution.
2024-09-13 07:40 AM
Hello,
There is no feature to lock the code generated by CubeMx.
Only "don't generate main.c" (from Project manager) and "don't generate function call" (from Advanced Settings) are available.
Meanwhile, for this:
@Scipio wrote:
I sometimes made some mistake and change the generated code.
I suggest to use one of the versioning tool like git/github to keep traces of your modification and be able to revert to a previous version.
2024-09-13 07:40 AM
Hello,
There is no feature to lock the code generated by CubeMx.
Only "don't generate main.c" (from Project manager) and "don't generate function call" (from Advanced Settings) are available.
Meanwhile, for this:
@Scipio wrote:
I sometimes made some mistake and change the generated code.
I suggest to use one of the versioning tool like git/github to keep traces of your modification and be able to revert to a previous version.
2024-09-13 08:44 AM
STM32CubeIDE doesn’t offer a direct "toggle read-only" feature for generated code sections. You can use external text editors like Visual Studio Code with specific plugins that allow locking parts of the code or syntax highlighting that dims auto-generated code.