CubeMX - USBX - Broken user code blocks and missing enum definitions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-08 12:19 AM - edited ‎2023-08-08 12:20 AM
STM32CubeIDE, Version: 1.13.1, Build: 17479_20230728_0839 (UTC)
STM32Cube MCU Package for STM32U5 Series, Version: 1.3.0
I am using USBX with enabled USB Device FS and AUDIO Device Class FS.
I found following problems and issues:
- USBX/App/ux_device_descriptors.h: Even when AUDIO Device Class is enabled, the CLASS_TYPE_AUDIO enum entry is not added into USBD_CompositeClassTypeDef enum definition. Since there are not USER CODE blocks, I cannot add this enum entry, without it being removed every IOC regeneration.
- USBX/App/ux_device_descriptors.c: Even when AUDIO Device Class is enabled, the CLASS_TYPE_AUDIO enum entry is not added into UserClassInstance array. Since there are not USER CODE blocks, I cannot add this enum entry, without it being removed every IOC regeneration.
- USBX/App/ux_device_descriptors.c: The user code block USER CODE FrameWork_AddToConfDesc_1 doesn't work properly (during IOC regeneration, the code inside of this block is always removed). This happens probably because the closing comment miss END keyword
- USBX/App/app_usbx_device.c: There is missing USER CODE block in function MX_USBX_Device_Init, before tx_thread_create call. Thus, when I register other class via ux_device_stack_class_register before creating the final usb device thread (in my case, registering audio class), my changes are always erased during IOC regeneration, as user code block is missing there.
Thanks
- Labels:
-
STM32U5 series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-08 1:40 AM
Hi @Despair1337 , Audio class 1.0 and 2.0 is supported by USBX stack but Code generation and Code init of those are not yet implemented in CubeMx you can refer to Microsoft AzureRTOS documentation to develop your Owen application : https://learn.microsoft.com/en-us/azure/rtos/usbx/usbx-device-stack-supplemental-2#usb-device-audio-class
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-08 1:44 AM - edited ‎2023-08-08 3:19 AM
Dear @mohamed.ayed , thank you for fast reply.
Yes, I am aware that the code generation for Audio is not implemented in STM32CubeMX, I integrated it by myself successfully.
Although even it is not officially implemented, I think that CubeMX should generate at least enum entries, so I can use it to provide own implementation. Also please note, that point (3) and (4) is general bug in USBX file templates, and they should be fixed, as user code are lost.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-16 10:37 PM
Dear @mohamed.ayed ,
please, would it be possible to report those bugs (mainly 3. and 4.) to CubeMX team, so user code areas can be fixed? Because of reported issues, CubeMX always clears our code, which we need to manually restore via git.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-03-06 8:18 PM
I also had your problem (3). I fixed it by modifying ux_device_descriptors_c.ftl, adding the 'BEGIN' and 'END' keywords to the USER CODE blocks that I care about. That fixed my problem, and I noticed there were several other blocks with the same error that I don't care about (yet):
Device_Framework1
String_Framework0
String_Framework1
HidReportDesc0
... and probably more. Can't be bothered searching. A smart person at ST should go through the template and fix it up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-04 11:10 PM
The issue is still present (STM32CubeIDE 1.15.1) and the latest STM32 platform.
