AnsweredAssumed Answered

STM32CubeMX 4.7.0 code generation issue

Question asked by giambra.marco.001 on Apr 29, 2015
Latest reply on Apr 30, 2015 by giambra.marco.001
Generating code from STM32CubeMX 4.7.0 (for STM32F072RBTx controller) messes up USER CODE 3 section of main.c, when an if instruction with braces is  present.
For instance, original code

/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
 
/* USER CODE BEGIN 3 */
    ApplicRun();
 
    if (cnt++ > 10000) {
        cnt = 0;
    }
 
}
/* USER CODE END 3 */

after automatic code generation becomes

/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
 
/* USER CODE BEGIN 3 */
    ApplicRun();
 
        cnt = 0;
    }
 
}
/* USER CODE END 3 */

Did I go wrong anywhere?

Outcomes