STM32CubeIDE: how to avoid losing Middleware code changes (USB)
Hello,
I plan to modify the USB Audio Class for a project created in STM32CubeIDE and using the USB Middleware library. I select the peripherals I need in the Device Configuration Tool, plus the USB_DEVICe Audio class. then I generate the code.
In all of the code, I can make changes as long as I put my code in the proper places guarded by /* USER CODE BEGIN */ / *USER CODE END */ .
There is no such mechanism for the USB classes. So if I modify or add a function, then later on I might need to re-generate the code using the Device Configuration Tool due to a project change (say, adding a GPIO pin), but doing so will overwrite all the USB files.
My workaround is to find and copy all the USB files I modified, copy them to a safe place, generate the code, then copy back my files. It's slow and error-prone
Is there a way to force STM32CubeIDE to avoid "stomping" middleware files? After all, no matter what I change in the device itself, the USB configuration is not changed. Even a checkbox option with "do not overwrite existing USB Middleware files" would help a lot.