AnsweredAssumed Answered

CubeMX code generation issue

Question asked by buga.d_niel on Sep 28, 2017
Latest reply on Nov 30, 2017 by buga.d_niel

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.

Outcomes