Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jspngh opened this issue Jan 10, 2023 · 1 comment
Open

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

jspngh opened this issue Jan 10, 2023 · 1 comment

Comments

@jspngh
Copy link

jspngh commented Jan 10, 2023

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
Copy link

AYEDMSTM commented Mar 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants