cancel
Showing results for 
Search instead for 
Did you mean: 

Transferring data using the built in USB HiSpeed Core

tarek
Associate
Posted on October 31, 2013 at 15:22

Hello guys,

I am frustrated. Since weeks now I am trying to build an application, that sends data from my Discovery board to the connected PC. The problem is that I want to use the HiSpeed Core with an external HiSpeed PHY connected via the ULPI interface.

So far everything is working. The enumeration is ok and I can transfer data via the control endpoint and for example turning leds on and off from my PC. But I cant send data using my bulk IN endpoint.

On the PC side I used libusbdotnet to communicate with my stm board. Everytime I try to send data I get an error called ''GetOverlapedResult in EP 0x81''.

But, when I use the same program with the built in FS Core of the stm discovery board and the pc connected via the micro usb port, everything works well. No errors and data is sent with approx 7 Mbps.

What am I doing wrong? There are three setup I tested so far:

&sharp1

Using the internal FS Core and connected the PC to the micro usb port.

Everything works well

&sharp2

Using the internal HS Core and the internal FS PHY in FS Mode.

Enumeration works, Control Transfers are working, BULK Transfer fails

&sharp3

Using the internal HS Core and an externam HS PHY in HS Mode.

Same as &sharp2. Enumeration works, Control Transfers are working, BULK Transfer fails

When I want to send 2048 Bytes of data I use the following Line:

DCD_EP_Tx (&USB_OTG_dev, 0x81, sendingBuffer, 2048);

My Device Descriptor is the following:

0x12,                       /*bLength */

    USB_DEVICE_DESCRIPTOR_TYPE, /*bDescriptorType*/

    0x00,                       /*bcdUSB */

    0x02,

    0x00,                       /*bDeviceClass*/

    0x00,                       /*bDeviceSubClass*/

    0x00,                       /*bDeviceProtocol*/

    64,      /*bMaxPacketSize*/

    LOBYTE(USBD_VID),           /*idVendor*/

    HIBYTE(USBD_VID),           /*idVendor*/

    LOBYTE(USBD_PID),           /*idVendor*/

    HIBYTE(USBD_PID),           /*idVendor*/

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

    0x01    /*bNumConfigurations*/

My Configuration Descriptor is the following:

/*Configuration Descriptor*/

  0x09,   /* bLength: Configuration Descriptor size */

  USB_CONFIGURATION_DESCRIPTOR_TYPE,      /* bDescriptorType: Configuration */

  USB_CDC_CONFIG_DESC_SIZ,                /* wTotalLength:no of returned bytes */

  0x00,

  0x01,   /* bNumInterfaces: 1 interface */

  0x01,   /* bConfigurationValue: Configuration value */

  0x00,   /* iConfiguration: Index of string descriptor describing the configuration */

  0xC0,   /* bmAttributes: self powered */

  0x32,   /* MaxPower 0 mA */

  

  /*---------------------------------------------------------------------------*/

  

  /*Interface Descriptor */

  0x09,   /* bLength: Interface Descriptor size */

  USB_INTERFACE_DESCRIPTOR_TYPE,  /* bDescriptorType: Interface */

  /* Interface descriptor type */

  0x00,   /* bInterfaceNumber: Number of Interface */

  0x00,   /* bAlternateSetting: Alternate setting */

  0x01,   /* bNumEndpoints: One endpoints used */

  0x00,   /* bInterfaceClass: Communication Interface Class */

  0x00,   /* bInterfaceSubClass: Abstract Control Model */

  0x00,   /* bInterfaceProtocol: Common AT commands */

  0x00,   /* iInterface: */

  

  /*Endpoint 2 Descriptor*/

  0x07,                           /* bLength: Endpoint Descriptor size */

  USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */

  0x81,                     /* bEndpointAddress */

  0x02,                           /* bmAttributes: Bulk */

&sharpifdef USE_EMBEDDED_PHY

  LOBYTE(64),     /* wMaxPacketSize: */

  HIBYTE(64),

&sharpelse

  LOBYTE(512),     /* wMaxPacketSize: */

  HIBYTE(512),

&sharpendif

  0x00

I think the error lies in using the HS Core. But what can I do? Did anybody transfer data via the HS Core?

Many thanks in advance.

#usb-hispeed-phy-ulpi-hs-fs-core
1 REPLY 1
dthedens23
Associate II
Posted on November 01, 2013 at 16:55

go here.

http://www.lvr.com/usb_virtual_com_port.htm

Windows requieres the additional ACM descriptors.  (even thought it does not really use them)

you might even need the Bulk OUT as well, even if you do not use it.  Fussy Windows drivers.

I have all three endpoints and the ACM and it works for me.