cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0B1RE Usb CDC descriptor not read, but USB DFU flash OK

FloSolio
Associate

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.

 

 

FloSolio_0-1760002154965.pngFloSolio_1-1760002186786.png

FloSolio_2-1760002204887.png

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...

1 REPLY 1
FloSolio
Associate

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*/
};