Skip to main content
danielbuga9
Associate III
September 28, 2017
Question

CubeMX code generation issue

  • September 28, 2017
  • 1 reply
  • 1000 views
Posted on September 28, 2017 at 10:00

Using CubeMX with CubeL4 1.9.0, I have the following problem.

I'm using FreeRTOS with tasks defined as either weak, or external (weak is only used because the default task cannot be external for whatever reason). My weak ApplicationTask is generated as follows:

/* ApplicationTask function */

__weak void ApplicationTask(void const * argument)

{

  /* init code for USB_DEVICE */

  MX_USB_DEVICE_Init();

  /* USER CODE BEGIN ApplicationTask */

  /* Infinite loop */

  for(;;)

  {

    osDelay(1);

  }

  /* USER CODE END ApplicationTask */

}

/* USER CODE BEGIN Application */

  /* Infinite loop */

  for(;;)

  {

    osDelay(1);

  }

/* USER CODE END Application */

Notice the user code segment named Application after the actual function. This causes the generated code to not compile without deleting this 'surplus' block.

    This topic has been closed for replies.

    1 reply

    stm32cube-t
    ST Employee
    October 19, 2017
    Posted on October 19, 2017 at 11:39

    Dear user,

    This issue will be fixed in our next release 4.23.

    Best regards.

    danielbuga9
    Associate III
    November 30, 2017
    Posted on November 30, 2017 at 09:10

    Hello,

    Just for reference, this issue was NOT fixed in 4.23.

    Thanks