AnsweredAssumed Answered

STM32CubeMX 4.7.0 Bug Report - main.c, user code corrupted

Question asked by Kolomaznik.Petr.001 on Mar 24, 2015
Latest reply on Apr 9, 2015 by Barta.Hank
My conditions:
STM32CubeMX 4.7.0
STM32F042F6P6 and STM32F103CT6

STM32CubeMX removes bracket inside /* USER CODE BEGIN 3 *//* USER CODE END 3 */ section of main.c.

STM32CubeMX 4.7.0
 
Code before regeneration:
...
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */
 
  /* USER CODE BEGIN 3 */
    if (1)
    {
 
    }
  }
  /* USER CODE END 3 */
}
 
Code after regenerations using STM32CubeMX 4.7.0:
...
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */
 
  /* USER CODE BEGIN 3 */
    if (1)
            /* <<< missing bracket */
    }
  }
  /* USER CODE END 3 */
}
 
STM32CubeMX 4.6.0 was correct:
...
  /* USER CODE BEGIN 3 */
  /* Infinite loop */
  while (1)
  {
    if (1)
    {
  
    }
  }
  /* USER CODE END 3 */
}

Outcomes