I-CUBE-USBD-Composite icon indicating copy to clipboard operation
I-CUBE-USBD-Composite copied to clipboard

User code is overwritten on CubeMX code generation

Open lbthomsen opened this issue 2 years ago • 4 comments

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)

lbthomsen avatar Sep 22 '21 07:09 lbthomsen

CubeMX Templates are not implemented yet.

alambe94 avatar Oct 06 '21 15:10 alambe94

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

lbthomsen avatar Oct 11 '21 00:10 lbthomsen

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

sammok avatar May 17 '23 09:05 sammok

Been doing the same pretty much

lbthomsen avatar May 24 '23 05:05 lbthomsen