STM32CubeIDE 1.14.1 deletes code from USER CODE BEGIN/END block
I have a project for STM32L452 using ThreadX and USBX, CubeIDE 1.14.1, firmware L4 1.18.0, on MacOS 14.3.1 Sonoma on Intel i9.
In USBX/App/ux_device_descriptors.h I have placed some code:
/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private_defines */
extern uint8_t serialNumber[];
/* USER CODE END Private_defines */
Ignore those line numbers, the real numbers are 264-267.
When I go into the GUI and change my USB PID to something new, save, and regenerate the code, the Private_defines block is now empty:
/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private_defines */
/* USER CODE END Private_defines */
So, for experimenting, I deleted the .h file and had the GUI regenerate the .h file from scratch, just to make sure that I hadn't put in anything that wasn't in the stock BEGIN/END guards, and the regen deleted my code again. Yes, this can be duplicated.
Here's a hint for you all (the walrus was Paul), the same Private_defines block is also generated at lines 248-251.
Here's another hint; if I put my code in the first Private_defines block, after the regen, my code gets pasted into BOTH Private_defines blocks.
That is all,
Andrei (from the Great White North)
