Skip to main content
Lead II
June 28, 2024
Question

STM32CubeMX inconsistent indentation for MX_TouchGFX_Process()

  • June 28, 2024
  • 3 replies
  • 947 views

 

If I enable USB host and TouchGFX without OS I get the following generated code:

 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 MX_USB_HOST_Process();

 MX_TouchGFX_Process();
 /* USER CODE BEGIN 3 */
 }
 /* USER CODE END 3 */

As you can see MX_TouchGFX_Process() isn't indented properly.

I want this:

 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 MX_USB_HOST_Process();
 MX_TouchGFX_Process();
 /* USER CODE BEGIN 3 */
 }
 /* USER CODE END 3 */

 

3 replies

Technical Moderator
July 3, 2024

Hello @unsigned_char_array 

Could you share the project or the name of the MCU that occur this issue ?

Thanks

Souhaib

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Lead II
July 3, 2024

STM32H735

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
Lead II
July 17, 2024

I've attached an ioc file to reproduce the problem. I just created a fresh project for the STM32H735G-DK
with everything set to default and enabled TouchGFX and USB host.

Result:

 

 /* USER CODE BEGIN WHILE */
 while (1)
 {
 /* USER CODE END WHILE */
 MX_USB_HOST_Process();

 MX_TouchGFX_Process();
 /* USER CODE BEGIN 3 */
 }
 /* USER CODE END 3 */

 


Edit: still not fixed in STM32CubeMX V6.12.1

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
Lead II
November 27, 2025

Still not fixed in STM32CubeMX V6.16.0

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."