cancel
Showing results for 
Search instead for 
Did you mean: 

What is MX__Init()?????

svcguy
Associate III

Have a project using CubeMX 5.5.0 from within CubeIDE 1.2.1 on Windows 10 for an STM32F767 using FW 1.15.0. Its a TouchGFX project so it, by default uses FreeRTOS. Whenever I regenerate code, I get this in the DefaultTask:

/* USER CODE BEGIN Header_StartDefaultTask */
/**
  * @brief  Function implementing the defaultTask thread.
  * @param  argument: Not used 
  * @retval None
  */
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const * argument)
{
  /* init code for */
  MX__Init();
  /* USER CODE BEGIN StartDefaultTask */
  printf("\tStarting default task...\n");
 
  /* Infinite loop */
  for(;;)
  {
    HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
    osDelay(500);
  }
  /* USER CODE END StartDefaultTask */
}

The pin toggle is of course user code but what is MX__Init()? Note two underscores between MX and Init. I thought maybe it was a typo and is supposed to be MX_Init() but there is no function named that either? Is this supposed to be code that is run or a bug/typo?

*.ioc file is attached

Andy

4 REPLIES 4
Karl Yamashita
Lead II

That is a bug. I used to get that same line of code though I haven't seen it lately. I believe that line should be to init the USB host

/* USER CODE BEGIN Header_StartDefaultTask */
/**
  * @brief  Function implementing the defaultTask thread.
  * @param  argument: Not used 
  * @retval None
  */
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void const * argument)
{
  /* init code for USB_HOST */
  MX_USB_HOST_Init();
  /* USER CODE BEGIN 5 */
  /* Infinite loop */
  for(;;)
  {
    osDelay(1);
  }
  /* USER CODE END 5 */ 
}

I Can't Believe It's Not Butter. If you find my answers useful, click the accept button so that way others can see the solution.
Khouloud ZEMMELI
ST Employee

​Hello @svcguy​ ,

Thanks for the feedback this will be internally checked.

Best Regards,

khouloud

Khouloud ZEMMELI
ST Employee

​@svcguy​  issue not reproduced on my side , Could you please give me more info or simple steps to obtain issue ?

Thanks,

Khouloud

Khouloud ZEMMELI
ST Employee

​Well , issue seems fixed on the 5.6.0 CubeMX version, so you will receive the fix in the next release (which is planned in W08).

Thank you again for your feedback.

Best Regards,

Khouloud