Skip to main content
WDobb.1
Associate
January 14, 2025
Question

USBX improper code generation

  • January 14, 2025
  • 4 replies
  • 1239 views

After editing the .IOC file, the code generator will mess up the app_usbx_device.c\MX_USBX_Device_Init() function by placing the code

if (ux_device_stack_initialize(...)

right after the variable declarations at the top of the function.

Typically, that function call should be around line 151 after 6 other function calls initialize all the pointer variables.

The end result is 8 compile warnings about using uninitialized variables.

Attempts to wrap the stack initialization in /* USER CODE BEGIN MX_USBX_Device_Init0 */ don't work, and the code generator will just move it to the top of the file anyway.

What is the work-around for this?

STM32H562VGTx

STM32CubeMX 6.12.0

STM32CubeIDE 1.16.0

 

4 replies

Technical Moderator
January 17, 2025

Hello @WDobb.1 ,

First let me thank you for posting and welcome to the ST Community.

For more investigation, I suggest please that you provide the Ioc.File.

Thanks.

Mahmoud

 

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.
WDobb.1
WDobb.1Author
Associate
January 17, 2025

The ioc file is attached.

WDobb.1
WDobb.1Author
Associate
February 7, 2025

I am including the file that gets manged vs. what the original one looks like.

 

 

Visitor II
May 29, 2025

What is the status on this? Is it expected to be fixed in the next release?

Visitor II
August 27, 2025

The fix for this issue is here: Case: 00241689