AnsweredAssumed Answered

Bug Report - USB - STM32F446 / STM32CubeMX

Question asked by zwarteveld.johan on Dec 22, 2017
Latest reply on Feb 2, 2018 by Gavin Baker

Dear ST,

 

First is there any publicly available Bug report site?

 

Found with SMT32CubeMX Version 4.23.0
and using the latest firmware package for stm32f4 (1.18.0)

 

USB Custom HID Device:

  1. STM32CubeMX Parameter Setting: USBD_SUPPORT_USER_STRING is always enable and can not be disabled
  2. USBD_SUPPORT_USER_STRING does not enable the function:
    uint8_t *     USBD_FS_USRStringDesc (USBD_SpeedTypeDef speed, uint8_t idx , uint16_t *length); 
    as its preprocessor check, checks on  USB_SUPPORT_USER_STRING_DESC
  3. uint8_t *     USBD_FS_USRStringDesc (USBD_SpeedTypeDef speed, uint8_t idx , uint16_t *length); 
    is not added to the USBD_DescriptorsTypeDef when USBD_SUPPORT_USER_STRING is enabled.
    resulting in a INVSTATE Usagefault when the device is connected to a pc for the first time where the PID / VID combination is unknown.
  4. uint8_t *     USBD_FS_USRStringDesc (USBD_SpeedTypeDef speed, uint8_t idx , uint16_t *length); is only a prototype and no function is generated
  5. No code available for the User String Descriptor in the usbd_desc.c
  6. in usbd_customhid.h:
    1. CUSTOM_HID_EPIN_SIZE is always set to 0x02 on STM32CubeMX generation and can not be configured. the STM32CubeMX USB Class Parameter: USBD_CUSTOMHID_OUTREPORT_BUF_SIZE isn't used
    2. CUSTOM_HID_EPOUT_SIZE is always set to 0x02 on STM32CubeMX generation and can not be configured. the STM32CubeMX USB Class Parameter: USBD_CUSTOMHID_OUTREPORT_BUF_SIZE isn't used
    3. USB_CUSTOM_HID_DESC_SIZ is always set to 0x09 on STM32CubeMX generation. the STM32CubeMX USB Class Parameter: USBD_CUSTOM_HID_REPORT_DESC_SIZE isn't used.
  7. Polling interval of the USBD_CUSTOM_HID_CfgDesc can not be configured in STM32CubeMX and are resetted to default every STM32CubeMX generation.
    1. Note the comments say its 20 ms polling interval. where in fact it is 32 ms. (value = 0x20)

Outcomes