Skip to main content
RAltm
Senior
July 1, 2026
Question

USBX user code sections are overwritten

  • July 1, 2026
  • 1 reply
  • 9 views

Hello,

I’m using CubeMX 6.18.0. I’m trying to implement a USBX standalone (bare-metal, no RTOS) CDC application. Code within user code sections is overwritten when re-generating the project. As far as I can see this is not a new problem, there are already some older topics about it. @ST: will this ever be fixed?

Regards

1 reply

ST Technical Moderator
July 1, 2026

Hello ​@RAltm 

Can you ensure that the option “Keep User Code when re-generating” is checked in Code Generator section:

Otherwise, could you please provide your IOC file in order to investigate the issue?

BR, Souhaib

To give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.