alambe94 / I-CUBE-USBD-Composite

Create STM32 USB Composite devices with ease.
MIT License
142 stars 30 forks source link

User code is overwritten on CubeMX code generation #2

Open lbthomsen opened 2 years ago

lbthomsen commented 2 years ago

When generating code from CubeMX all source files are completely overwritten. Even "user code" sections - like this (from usbd_msc_if.c:

/* USER CODE BEGIN PV */
/* Private variables ---------------------------------------------------------*/
uint8_t MSC_Storage[32*1024];
/* USER CODE END PV */

(just one example)

alambe94 commented 2 years ago

CubeMX Templates are not implemented yet.

lbthomsen commented 2 years ago

Sure :) Let me know if you want me to test something when or if you implement it.

sammok commented 1 year ago

for me, the way to solve this problem is make this middleware as yourself's code

once you completed your config, you can try move AL94_USB_Composite/ to root directory out of Middlewares/ and make a copy of Composite/ which in root directory created by I-CUBE-USBD-Composite

then go to the IOC, cancel the I-CUBE-USBD-COMPOSITE

then go to project properties -> C/C++ General -> Paths and Symbols, add AL94_USB_Composite/ and Composite/ path to your compiler

lbthomsen commented 1 year ago

Been doing the same pretty much