Skip to main content
Senior II
August 23, 2021
Solved

Why does configuration tool code generator changes my code in main between /* USER CODE BEGIN 5 */ and /* USER CODE END 5 */? I thought user code sections where untouched? What can be wrong?

Everytime i run code generator, the main file is changed between User Code ?

 */
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const * argument)
{
 /* USER CODE BEGIN 5 */
 /* Infinite loop */
 for(;;)
 {
	LedTask();
 osDelay(1);
 }
 /* USER CODE END 5 */
}

    This topic has been closed for replies.
    sde c.1Best answer
    Senior II
    August 23, 2021

    yes i always save the main file before generating code.

    Found the issue, when creating another task i accidently copied the "/* USER CODE BEGIN 5 */" label from the main task.

    There can be only 1 unique label !

    Thank you

    3 replies

    Javier1
    Principal
    August 23, 2021

    Did you saved the changes? before autogenerating?

    Maybe the /* Infinite loop */ label is messing with the code generator?

    hit me up in https://www.linkedin.com/in/javiermuñoz/
    sde c.1AuthorBest answer
    Senior II
    August 23, 2021

    yes i always save the main file before generating code.

    Found the issue, when creating another task i accidently copied the "/* USER CODE BEGIN 5 */" label from the main task.

    There can be only 1 unique label !

    Thank you

    Javier1
    Principal
    August 23, 2021

    ha! good one.

    Tag yourself as best answer then

    hit me up in https://www.linkedin.com/in/javiermuñoz/