cancel
Showing results for 
Search instead for 
Did you mean: 

USBX improper code generation

WDobb.1
Associate II

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

 

3 REPLIES 3
Mahmoud Ben Romdhane
ST Employee

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.

The ioc file is attached.

WDobb.1
Associate II

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