2025-10-09 2:32 AM
Hi,
I'm try to communicate between my windows pc and my STM32GOB1RE Nucleo 64 board, with the CDC Class.
To validate my hardware ( PA11 PA12 and gnd connected to usb pc), i did few dfu flahsing operation with CubeProg without issue. Windows detect properly my device in DFU mode, i can do the programmation and new firmware runs well. -> Hardware looks fine.
I have generated the code with CubeMX and i'm using the HSI to 60mhz. Just this simple code with USB_DRD_FS
Usb clock derived from it at 48Mhz.
I'm also using the SOF detection and CRS SYNC Source USB.
I have added th Code line in usbd_cdc_if, but it is not really the problem.
Windows generate Error of not Descriptor reading.
Here is the log of the USB Device Viewer, a windows tool that bring information:
[Port7] FailedEnumeration : Périphérique USB inconnu (échec de demande de descripteur de périphérique)
[Port7] FailedEnumeration : Périphérique USB inconnu (échec de demande de descripteur de périphérique)
Is Port User Connectable: yes
Is Port Debug Capable: no
Companion Port Number: 0
Companion Hub Symbolic Link Name:
Protocols Supported:
USB 1.1: yes
USB 2.0: yes
USB 3.0: no
---===>Device Information<===---
ConnectionStatus: FailedEnumeration
Current Config Value: 0x00 -> Device Bus Speed: Full (is not SuperSpeed or higher capable)
Device Address: 0x00
Open Pipes: 0
*!*ERROR: No open pipes!
===>Device Descriptor<===
*!*ERROR: bLength of 0 incorrect, should be 18
bLength: 0x00
bDescriptorType: 0x00
bcdUSB: 0x0000
bDeviceClass: 0x00
*!*ERROR: Device enumeration failure
I don't understand why i'm able to transfert firware to memory through my DFU operation, and i'm not able to send the descriptor informations to windows.
May be a small thing is missing somewhere...
Solved! Go to Solution.
2025-10-09 10:45 AM
Thanks every body,
I solved the issue.
I had to enable the usb interrupt.
Moreover, i had an issue in embedeed cube mx that was not updating the code when I changed the oscillator settings.
I checked the dfu bootloader application note that mentions 60mhz and interrupt.
I works now.
Just to answer, i'm using the nucleo board with stm32g0b1re. Usb cable is connected on PA11 and PA12 and gnd.
One thing that confused me is the mismatch between in the documention "crystal less" criteria is "-" meaning that normally, this device needs external HSE and the fact that in cubeMx i can use the HSI to generate the HSI48 for usb.
One last stuff now is that i need to check if i can start the dfu sequence from a usb cdc data that i send with my computer, for example "GODFU". I have seen a so called " composite" mode to have usb cdc +dfu. As DFU is in the ROM, not sure that it will be needed.
2025-10-09 2:48 AM
I join the simple project in a zip file.
Here is the descriptor in usbd_desc:
We can see that bLength is 0x12 = 18.
__ALIGN_BEGIN uint8_t USBD_CDC_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END =
{
0x12, /*bLength */
USB_DESC_TYPE_DEVICE, /*bDescriptorType*/
0x00, /*bcdUSB */
0x02,
0x02, /*bDeviceClass*/
0x02, /*bDeviceSubClass*/
0x00, /*bDeviceProtocol*/
USB_MAX_EP0_SIZE, /*bMaxPacketSize*/
LOBYTE(USBD_VID), /*idVendor*/
HIBYTE(USBD_VID), /*idVendor*/
LOBYTE(USBD_PID), /*idProduct*/
HIBYTE(USBD_PID), /*idProduct*/
0x00, /*bcdDevice rel. 2.00*/
0x02,
USBD_IDX_MFC_STR, /*Index of manufacturer string*/
USBD_IDX_PRODUCT_STR, /*Index of product string*/
USBD_IDX_SERIAL_STR, /*Index of serial number string*/
USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/
};
2025-10-09 9:57 AM
Hi @FloSolio
Did you try other USB enumeration tools? Have you tried using X Nucleo shield or is it custom HW? I suggest you try with different product PID since you mentioned it get's enumerated properly as DFU.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-10-09 10:22 AM
For CRS sync to work, USB clock must be derived from HSI48, not from HSI.
2025-10-09 10:45 AM
Thanks every body,
I solved the issue.
I had to enable the usb interrupt.
Moreover, i had an issue in embedeed cube mx that was not updating the code when I changed the oscillator settings.
I checked the dfu bootloader application note that mentions 60mhz and interrupt.
I works now.
Just to answer, i'm using the nucleo board with stm32g0b1re. Usb cable is connected on PA11 and PA12 and gnd.
One thing that confused me is the mismatch between in the documention "crystal less" criteria is "-" meaning that normally, this device needs external HSE and the fact that in cubeMx i can use the HSI to generate the HSI48 for usb.
One last stuff now is that i need to check if i can start the dfu sequence from a usb cdc data that i send with my computer, for example "GODFU". I have seen a so called " composite" mode to have usb cdc +dfu. As DFU is in the ROM, not sure that it will be needed.