2025-08-08 12:17 AM - edited 2025-08-08 12:40 AM
Hello,
After I use STM32CUBEIDE's built-in STM32CUBEMX to generate code, the source files and header files under the folder I created myself disappeared, how can this be solved?
Before I use STM32CUBEIDE's built-in STM32CUBEMX to generate code:
After I use STM32CUBEIDE's built-in STM32CUBEMX to generate code,all the files I created disappeared.
The compilation path of the file I created has already been saved, and I also checked the keep user code when re-generating option
2025-08-08 12:29 AM
Hello @sky_lin
Could you attach your project to investigate the issue?
KR,
Souhaib
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.
2025-08-08 12:42 AM
Yeah , I have uploaded my project.
2025-08-08 1:45 PM
Also see this (in the "too late to help this time but will help NEXT time): https://community.st.com/t5/stm32cubeide-mcus/my-usb-cdc-if-file-was-deleted-by-code-automatically-without/m-p/814264#M36899
Even the best written tools can fall prey to OS/hardware issues beyond their control and corrupt your data.
2025-08-13 2:24 AM
Hello @sky_lin
Could you please check the copy only the necessary files, this is will keep your custom files.
KR,
Souhaib
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.
2025-08-13 8:16 PM
I checked this option and changed it to the next option, but the problem persists
2025-08-18 12:40 AM - edited 2025-08-18 12:41 AM
Hello @sky_lin
Thank you for your detailed explanation.
The dedicated team are already aware of this issue (Internal Ticket number 196837), and fix will be implemented soon. In meantime, I recommend not placing your folder inside any CubeMX-generated directories (Drivers, Core, Middleware). Instead, please place it directly under the project root.
BR,
Souhaib
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.