2026-05-10 11:05 AM
Hi,
I spent a few days trying to make Ux_Device_HID and Ux_Device_HID_Standalone to work on Ubuntu with latest versions of CubeMX and Cube IDE (STM32CubeIDE Version: 2.1.1, STM32CubeMX 6.17.0)
The only way I managed Ux_Device_HID to work on NUCLEO-H723ZG was by the following steps:
However, if I want to open it in CubeMX and generate code even without any changes - the resulting code does not work at all. I used git to do diff and changes are all over..
Of course I could do changes in CubeIDE directly without nice MX interface, but I kind of like it simple ))
Anyway, could someone form ST explain why *.ioc file from example cannot be used with Cube MX to generate a working code?
2026-05-11 3:10 AM - edited 2026-05-11 3:10 AM
Hello @Lex,
Did you try to take a look at:
x-cube-azrtos-h7/Projects/NUCLEO-H723ZG/Applications/USBX/Ux_Device_HID
This is a relevant reference and should be useful for your application.
I hope my answer has helped you. When your question is answered, please select this topic as the solution that answered you, as it will help others find that answer faster.
Thanks for your contribution.
Dor_RH
2026-05-11 3:32 AM
Hi @Lex
If I understand you correctly, the firmware examples provided are sometimes older than the current CubeMX generator. As a result, the examples are not always intended to be regenerated directly from the .ioc file.
It would be helpful if you could share your diff and describe the issue you are seeing, so we can review it and report it if needed to better preserve the same structure.
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.
2026-05-16 1:11 PM
Hi,
I re-tested this issue today. Apparently a newly created code with MX or IDE works. I dunno if my Linux apps or installed packages were updated or not, but I can't see problem directly.
However I found problem with the following in the earlier created example code (without initial changes by MX):
Start doing diff - a lot of system file changes (for example, CMSIS version changed from 1.10.5 to 1.10.7)
The only important change in app code I found was missing memset() line in usb_otg.c:
/* USER CODE BEGIN USB_OTG_HS_Init 1 */
memset(&hpcd_USB_OTG_HS, 0x0, sizeof(PCD_HandleTypeDef));
/* USER CODE END USB_OTG_HS_Init 1 */See diff of the old and new:
Even it was between user input comments it was gone. Possibly due to change in comment styles...
I assume the change of the text after "USER CODE BEGIN" is the reason MX generated code failed if there was something in between lines. Hope this clarification helps.
Cheers
2026-05-17 11:33 AM
Yes, this example was used. See my comment to the next reply.
2026-05-18 2:43 AM
Hi @Lex
Would you attach you ioc file ?
What you observed is can be consistent with regenerating an older example with a newer CubeMX version. In such cases, the generated code structure can change, and some user code sections may not be preserved exactly as in the original example.
That is why we need to check whether this is a CubeMX issue or whether some required user code is missing.
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.
2026-05-18 6:27 AM
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.