CubeMX and CubeIDE interaction - User Code being overwritten
Hello,
when I change configuraion of my procejt STM32F103 in CubeMX e.g.
PIN&Configuration / SYS / Debug item is changed from "4 pins" to "5 pins" and I push "GENERATE buton" the code inside While cycle in main.c function in CubeIDE is changed at the same time. It is terrible. I thought that If I insert my user code inside the /* USER CODE END WHILE */ clause all such code is protected against changing when configuraion of my project is done in CubeMX. But it is NOT true. How can I solve this problem ?
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
// LED ON
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_RESET);
HAL_Delay(500);
// LED OFF
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
HAL_Delay(500);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
