STMicroelectronics / x-cube-azrtos-h7

X-CUBE-AZRTOS-H7 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32H7 series of microcontrollers.
https://www.st.com/en/embedded-software/x-cube-azrtos-h7.html
Other
149 stars 56 forks source link

Bug in generated code for USBX with CDC-ECM Class #28

Open jspngh opened 1 year ago

jspngh commented 1 year ago

A bug is present when using STM32CubeIDE to generate code that uses USBX with the CDC-ECM device class. The ux_device_descriptors.c file contains following code:

#if USBD_CDC_ECM_CLASS_ACTIVATED == 1

  /* Set MAC_STRING_INDEX and MAC_STRING in string_framework */
  count += len + 1;
  USBD_string_framework[count++] = USBD_LANGID_STRING & 0xFF;
  USBD_string_framework[count++] = USBD_LANGID_STRING >> 8;
  USBD_string_framework[count++] = CDC_ECM_MAC_STRING_INDEX;

  /* Set the Mac address in USBD_string_framework */
  USBD_Desc_GetString((uint8_t *)CDC_ECM_LOCAL_MAC_STR_DESC, USBD_string_framework + count, &len);

#endif /* USBD_CDC_ECM_CLASS_ACTIVATED */

However, CDC_ECM_LOCAL_MAC_STR_DESC is wrong here, it should be CDC_ECM_REMOTE_MAC_STR_DESC. See also here:

The remote node must be the same one as the one declared in the device framework string descriptor.

AYEDMSTM commented 1 year ago

@jspngh , thanks for this point we will fix this bug in next release