<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>STM32F103 USB HID using Endpoints (no answer from EP1)</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/31449/stm32f103-usb-hid-using-endpoints-no-answer-from-ep1</link><description> 
Hi Guys, 
I sit for days on my USB transfer. I work with a STM32F103C8
microcontroller. 
I want to build a transmission with 2 endpoints to transfer my Data
from the (GUI) Host. 
My problem are the endpoints. I can not get data from the
endpoint. 
It</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: STM32F103 USB HID using Endpoints (no answer from EP1)</title><link>https://community.arm.com/thread/128075?ContentTypeID=1</link><pubDate>Sat, 16 Mar 2013 19:34:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ec2a6473-2e24-44d1-b735-c7966c20a8b8</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
Ah, on the device side,&lt;br /&gt;
device receives / sends just 64 bytes report, without report ID.&lt;/p&gt;

&lt;p&gt;
PC HID driver strips / adds the report ID: 0.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: STM32F103 USB HID using Endpoints (no answer from EP1)</title><link>https://community.arm.com/thread/120000?ContentTypeID=1</link><pubDate>Sat, 16 Mar 2013 19:29:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:717fca8c-f98b-4549-8838-767b55d991b2</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
On the host application,&lt;/p&gt;

&lt;p&gt;
Count in the report ID byte for the nNumberOfBytesToWrite of
WriteFile() and nNumberOfBytesToRead of ReadFile(), even if no report
ID is used on the report descriptor. To send 64 bytes report of no
report ID, 65 bytes (report ID: 0, and following 64 bytes report
body) are exchanged.&lt;/p&gt;

&lt;pre&gt;
WriteFile(WriteHandle, &amp;amp;OutputPacketBuffer, &lt;b&gt;65&lt;/b&gt;, &amp;amp;BytesWritten, 0); //Sending process
ReadFile(ReadHandle, &amp;amp;InputPacketBuffer, &lt;b&gt;65&lt;/b&gt;, &amp;amp;BytesRead, 0);       //Receiving process
&lt;/pre&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: STM32F103 USB HID using Endpoints (no answer from EP1)</title><link>https://community.arm.com/thread/84843?ContentTypeID=1</link><pubDate>Sat, 16 Mar 2013 14:44:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:04a70a84-e109-4b96-b4e0-fab1a9f3dd76</guid><dc:creator>Peter Beck</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hey Tsuneo,&lt;/p&gt;

&lt;p&gt;
cool that you responded so quickly =) I&amp;#39;ve read many reports from
you.&lt;br /&gt;
All are really excellent.&lt;/p&gt;

&lt;p&gt;
Yes, I want to build a bidirectional connection to the host.(An
example in C++ .Net).&lt;br /&gt;
It should act like a UART connection.&lt;br /&gt;
In and Out connection with interrupt mode at 64 byte per frame.&lt;br /&gt;
I have changed the example (C:\Keil\ARM\Boards\Keil\MCBSTM32\USBHID)
and added the endpoint 1.&lt;br /&gt;
I guess it works so far. Further up the thread is a report from the
USB connection device.&lt;br /&gt;
I do not know if everything is correct. But you can see the Report
from USB Sniffer.&lt;/p&gt;

&lt;p&gt;
But I know now that I need only one endpoint, because this IN and
Out support.&lt;br /&gt;
I&amp;#39;ll change it now in my firmware.&lt;/p&gt;

&lt;p&gt;
Thats the .net GUI Interface:&lt;/p&gt;

&lt;pre&gt;

unsigned char OutputPacketBuffer[65];
unsigned char InputPacketBuffer[65];


private: System::Void get_set_data_from_device(System::Object^ sender, System::EventArgs^  e){

  DWORD BytesWritten = 0;
  DWORD BytesRead = 0;


InputPacketBuffer[0] = 0;
OutputPacketBuffer[0] = 0;

OutputPacketBuffer[1] = 0x00;  //Some Values in my send buffer
OutputPacketBuffer[2] = 0x01;  //Some Values in my send buffer
OutputPacketBuffer[3] = 0x01;  //Some Values in my send buffer



WriteFile(WriteHandle, &amp;amp;OutputPacketBuffer, 64, &amp;amp;BytesWritten, 0); //Sending process
ReadFile(ReadHandle, &amp;amp;InputPacketBuffer, 64, &amp;amp;BytesRead, 0);       //Receiving process

InputPacketBuffer[1]; //Some data from my Device at the endpoint IN
InputPacketBuffer[2]; //Some data from my Device at the endpoint IN
InputPacketBuffer[3]; //Some data from my Device at the endpoint IN

}
&lt;/pre&gt;

&lt;p&gt;
The problem is, that i never received or sends some data to or
from my Device (STM32F103C8)....&lt;br /&gt;
Just *** =(&lt;/p&gt;

&lt;p&gt;
Beste Regards&lt;br /&gt;
Peter&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: STM32F103 USB HID using Endpoints (no answer from EP1)</title><link>https://community.arm.com/thread/61764?ContentTypeID=1</link><pubDate>Sat, 16 Mar 2013 09:45:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:137c21f0-5a14-4a6f-8161-00c2e87ac205</guid><dc:creator>Peter Beck</dc:creator><description>&lt;p&gt;&lt;p&gt;
next&lt;/p&gt;

&lt;pre&gt;
BOOL HID_GetReport (void) {

  /* ReportID = SetupPacket.wValue.WB.L; */
  switch (SetupPacket.wValue.WB.H) {
    case HID_REPORT_INPUT:
      //GetInReport();
      //EP0Buf[0] = InReport;      //I Removed EP0 transmisson
      break;
    case HID_REPORT_OUTPUT:
      return (__FALSE);        /* Not Supported */
    case HID_REPORT_FEATURE:
      /* EP0Buf[] = ...; */
      /* break; */
      return (__FALSE);        /* Not Supported */
  }
  return (__TRUE);
}

BOOL HID_SetReport (void) {

  /* ReportID = SetupPacket.wValue.WB.L; */
  switch (SetupPacket.wValue.WB.H) {
    case HID_REPORT_INPUT:
      return (__FALSE);        /* Not Supported */
    case HID_REPORT_OUTPUT:
      //OutReport = EP0Buf[0];       //I Removed EP0 transmisson
      //SetOutReport();
      break;
    case HID_REPORT_FEATURE:
      return (__FALSE);        /* Not Supported */
  }
  return (__TRUE);
}

//*********************************USBSniffer Report***************************************

port 2 : USB-HID (Human Interface Device)

Parameter       Value
Hardware ID     USB\Vid_c251&amp;amp;Pid_1c01&amp;amp;Rev_0100
Setup Class     HIDClass
Class GUID      {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}
PDO Name        \Device\USBPDO-8
Service Name    HidUsb

Parameter       Value
Connection Information
ConnectionIndex         0x2
CurrentConfigurationValue       0x1
Speed   0x1 (UsbFullSpeed)
DeviceIsHub     FALSE
DeviceAddress   0x1
NumberOfOpenPipes       0x2
ConnectionStatus        DeviceConnected
Pipe #0
Endpoint Descriptor
bLength         0x7
bEndpointAddress        0x81 [IN]
bmAttributes    0x3 (USB_ENDPOINT_TYPE_INTERRUPT)
wMaxPacketSize  0x40
bInterval       0x1
Pipe #1
Endpoint Descriptor
bLength         0x7
bEndpointAddress        0x1 [OUT]
bmAttributes    0x3 (USB_ENDPOINT_TYPE_INTERRUPT)
wMaxPacketSize  0x40
bInterval       0x1
Device Descriptor
bLength         0x12
bcdUSB  0x0200 (USB 2.0)
bDeviceClass    0x0
bDeviceSubClass         0x0
bDeviceProtocol         0x0
bMaxPacketSize0         0x8
idVendor        0xC251 (Keil Software, Inc.)
idProduct       0x1C01
bcdDevice       0x100
iManufacturer   0x1 (0x409: Keil Software)
iProduct        0x2 (0x409: Keil MCBSTM32 HID)
iSerialNumber   0x3 (0x409: 0001A0000000)
bNumConfigurations      0x1

Parameter       Value
Configuration Descriptor
bLength         0x9
bDescriptorType         USB_CONFIGURATION_DESCRIPTOR_TYPE
wTotalLength    0x29
bNumInterfaces  0x1
iConfiguration  0x0
bmAttributes    0x80 ( Bus_Powered )
MaxPower        0x32
Interface Descriptor
bLength         0x9
bInterfaceNumber        0x0
bAlternateSetting       0x0
bNumEndpoints   0x2
bInterfaceClass         0x3 (Human Interface Device)
bInterfaceSubClass      0x0 (No Subclass)
bInterfaceProtocol      0x0 (None)
iInterface      0x0
Endpoint Descriptor
bLength         0x7
bEndpointAddress        0x81 [IN]
bmAttributes    0x3 (USB_ENDPOINT_TYPE_INTERRUPT)
wMaxPacketSize  0x40
bInterval       0x1
Endpoint Descriptor
bLength         0x7
bEndpointAddress        0x1 [OUT]
bmAttributes    0x3 (USB_ENDPOINT_TYPE_INTERRUPT)
wMaxPacketSize  0x40
bInterval       0x1


&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>