Skip to content

missing initializer for field 'GetBOSDescriptor ' of 'USBD_DescriptorsTypeDef' #39

@woquchonglang

Description

@woquchonglang

Caution
The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post a topic in the ST Community/STM32 MCUs forum.

Describe the set-up

  • The board (either ST RPN reference or your custom board).
    stm32h723
  • IDE or at least the compiler and its version.
    arm-none-eabi-gcc 15.2

Describe the bug
A clear and concise description of what the bug is.
when I use usb cdc (the code generated by stm32CubeMX) , the compiler warn:

USB_DEVICE/App/usbd_desc.c:146:1: warning: missing initializer for field 'GetBOSDescripto
' of 'USBD_DescriptorsTypeDef' [-Wmissing-field-initializers]

How To Reproduce

  1. Indicate the global behavior of your application project.

  2. The modules that you suspect to be the cause of the problem (Driver, BSP, MW ...).

  3. The use case that generates the problem.
    just build the code which generated by stm32CubeMX on cmake

  4. How we can reproduce the problem.
    just build the code which generated by stm32CubeMX on cmake

Additional context
If you have a first analysis or patch correction, thank you to share your proposal.
maybe it can fix, The reference I used was stm32f4 soc, because when I use stm32f4 usb cdc, it has the macro

USBD_DescriptorsTypeDef FS_Desc =
{
  USBD_FS_DeviceDescriptor
, USBD_FS_LangIDStrDescriptor
, USBD_FS_ManufacturerStrDescriptor
, USBD_FS_ProductStrDescriptor
, USBD_FS_SerialStrDescriptor
, USBD_FS_ConfigStrDescriptor
, USBD_FS_InterfaceStrDescriptor
#if (USBD_LPM_ENABLED == 1)
, USBD_FS_USR_BOSDescriptor
#endif /* (USBD_LPM_ENABLED == 1) */
};

but when I use stm32h723, it didn't initializer for field 'GetBOSDescripto' of 'USBD_DescriptorsTypeDef'

USBD_DescriptorsTypeDef HS_Desc =
{
  USBD_HS_DeviceDescriptor
, USBD_HS_LangIDStrDescriptor
, USBD_HS_ManufacturerStrDescriptor
, USBD_HS_ProductStrDescriptor
, USBD_HS_SerialStrDescriptor
, USBD_HS_ConfigStrDescriptor
, USBD_HS_InterfaceStrDescriptor
};

Screenshots
If applicable, add screenshots to help explain your problem.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcube mxinternal bug trackerIssue confirmed and reported into a ticket in the internal bug tracking systemmwMiddleware-related issue or pull-request.st usbSTMicroelectronics' Universal Serial Bus (Host or Device) libraryusbUSB-related (host or device) issue or pull-request

Type

Projects

Status

Analyzed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions