Skip to main content
Associate
August 8, 2025
Question

After STM32CubeMX generated the code, the file I created earlier disappeared

  • August 8, 2025
  • 1 reply
  • 463 views

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:

sky_lin_0-1754636938922.png

      After I use STM32CUBEIDE's built-in STM32CUBEMX to generate code,all the files I created disappeared.

sky_lin_1-1754637066045.png

     The compilation path of the file I created has already been saved, and I also checked the keep user code when re-generating option

sky_lin_2-1754637289095.pngsky_lin_3-1754637346653.png

 

1 reply

Technical Moderator
August 8, 2025

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.
sky_linAuthor
Associate
August 8, 2025

Yeah , I have uploaded my project.

Bob S
Super User
August 8, 2025

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.