Skip to main content
Visitor II
June 18, 2025
Question

my USB CDC IF File was deleted by code automatically without asking

  • June 18, 2025
  • 5 replies
  • 426 views

I don't know we are going where with this software. after update i was tried some pin name changes and pressed generate code.. and my USB CDC IF file gone.. with my codes.. how do i trust this software.. where do we go.. and now no where to config usb cdc and nothing work instead no usb descriptor error. how to recover? can i go back to old version? why is this software like this?

 

5 replies

TDK
Super User
June 18, 2025

Please don't repost.

Normal USB CDC Cannot Define after update. - STMicroelectronics Community

 

While this may not be the exact same issue, it's clearly heavily related and should be in the same thread.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
June 18, 2025

You might try recovering older instances of a file via File Manager

 

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Pavel A.
Super User
June 18, 2025

If you have a Windows machine, you can use the Quick Assist app to request help from a remote expert.

Do you remember which version of CubeMX or IDE or libraries you had before update?

PavelA_0-1750278910304.png

 

 

Bob S
Super User
June 18, 2025

I know this is not any help for your current situation, but for the future:

  • Don't trust any code generator tool
  • Use version control ("git" is free an commonly used, and on Windows comes with a GUI interface as well as command line)
  • Always back up your files (i.e. commit to the version control repository) before you update any tools or re-generate any code
  • Back up your version control repo (clone to GitHub, GitLab, etc. web sites if your company policy allows, else copy to a networked or USB drive.

 

Karl Yamashita
Principal
June 18, 2025

Been there, done that. 1 hour of coding in main.c and generating code, then the program crashed. Puff, main.c file was gone.

So now you know what could possibly happen when writing your code within ST's file. Lesson learned. So moving forward, you train yourself to write your code in your own files that ST code generation tool can't touch.

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source