2026-02-06 6:34 PM
Hi,
I encountered a strange problem while using stm32cubeMX in a new project.
Everytime i saved the code files and then regenerated the code using stm32cubeMX,the user code will gone.
A example,"#include "led.h" " have been insert in the user code zone,then i saved the project,and regenerated code using stm32cubeMX.
then "#include "led.h" " is missing...
"Keep User Code When re-generating" already been checked as shown in the figure。
stm32cubeMX version 6.16.1.
any advise will be appreciated,thx.
2026-02-06 6:40 PM
Please include your ioc file to see if it can be duplicated.
2026-02-08 11:24 PM
2026-02-12 6:30 AM
Hello @solaidee
Any updates regarding this issue? Did MX work correctly for you?
If you still need help, please either share your IOC file or, at a minimum, describe the exact steps to reproduce the issue.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.