2025-07-24 3:42 AM
Hi
I'm working on a firmware based on a STM32WL libraries example, specifically LoraWan_End_Node for WL55JC.
The example sends data every 10s but also performs several operations using leds and timer. I need to remove some parts of this original code and sometimes write outside the USER_CODE_BEGIN/END sections.
The problem is, when I use CubeMX it will restore the original code where I changed it. Is there any way to prevent this restoring? And at the same time be able to use the CubeMX.
Thanks
2025-07-24 3:47 AM
@smassardi wrote:Is there any way to prevent this restoring?
No. That is the defined behaviour - only code within the USER CODE markers is retained.
You will have to manually merge your changes back into the code.
There is an option to have CubeMX backup the files that it re-generates: