Skip to main content
WDobb.1
Associate
Question

USBX improper code generation

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

 

This topic has been closed for replies.

5 replies

ST Technical Moderator

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

The ioc file is attached.

WDobb.1
WDobb.1Author
Associate

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

 

 

Visitor II

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

Visitor II

The fix for this issue is here: Case: 00241689