<?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>STM32: USBH_BulkReceiveData() Usage</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/39950/stm32-usbh_bulkreceivedata-usage</link><description> 
Hello! 

 
I&amp;#39;m currently trying to implement a simple USB CDC Host. I used
the following thread as reference: http://www.keil.com/forum/20569/ 
by Tsuneo Chinzei! It works well so far, I could enumerate my device
and successfully used USBH_BulkSendData</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: STM32: USBH_BulkReceiveData() Usage</title><link>https://community.arm.com/thread/80680?ContentTypeID=1</link><pubDate>Wed, 24 Oct 2012 11:23:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ffb9fca1-4c8c-4ed6-8f3f-ae8cd7520cb0</guid><dc:creator>Thomas Kroesswang</dc:creator><description>&lt;p&gt;&lt;p&gt;
I forgot to mention that my device is a CDC ACM (Abstract Control
Model) class USB-sensor.&lt;/p&gt;

&lt;p&gt;

-----------------------------------------------------------------------------------------&lt;br /&gt;

[Port4] : URG Series USB Device Driver&lt;/p&gt;

&lt;p&gt;
---===&amp;gt;Device Information&amp;lt;===---&lt;br /&gt;
English product name: &amp;quot;URG-Series USB Driver&amp;quot;&lt;/p&gt;

&lt;p&gt;
ConnectionStatus:&lt;br /&gt;
Current Config Value: 0x01 -&amp;gt; Device Bus Speed: Full&lt;br /&gt;
Device Address: 0x01&lt;br /&gt;
Open Pipes: 3&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Endpoint Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x07&lt;br /&gt;
bDescriptorType: 0x05&lt;br /&gt;
bEndpointAddress: 0x83 -&amp;gt; Direction: IN - EndpointID: 3&lt;br /&gt;
bmAttributes: 0x03 -&amp;gt; Interrupt Transfer Type&lt;br /&gt;
wMaxPacketSize: 0x0010 = 0x10 bytes&lt;br /&gt;
bInterval: 0x10&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Endpoint Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x07&lt;br /&gt;
bDescriptorType: 0x05&lt;br /&gt;
bEndpointAddress: 0x02 -&amp;gt; Direction: OUT - EndpointID: 2&lt;br /&gt;
bmAttributes: 0x02 -&amp;gt; Bulk Transfer Type&lt;br /&gt;
wMaxPacketSize: 0x0040 = 0x40 bytes&lt;br /&gt;
bInterval: 0x00&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Endpoint Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x07&lt;br /&gt;
bDescriptorType: 0x05&lt;br /&gt;
bEndpointAddress: 0x81 -&amp;gt; Direction: IN - EndpointID: 1&lt;br /&gt;
bmAttributes: 0x02 -&amp;gt; Bulk Transfer Type&lt;br /&gt;
wMaxPacketSize: 0x0040 = 0x40 bytes&lt;br /&gt;
bInterval: 0x00&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Device Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x12&lt;br /&gt;
bDescriptorType: 0x01&lt;br /&gt;
bcdUSB: 0x0200&lt;br /&gt;
bDeviceClass: 0x02 -&amp;gt; This is a Communication Device&lt;br /&gt;
bDeviceSubClass: 0x00&lt;br /&gt;
bDeviceProtocol: 0x00&lt;br /&gt;
bMaxPacketSize0: 0x40 = (64) Bytes&lt;br /&gt;
idVendor: 0x15D1 = Vendor ID not listed with USB.org as of
03-19-2008&lt;br /&gt;
idProduct: 0x0000&lt;br /&gt;
bcdDevice: 0x0100&lt;br /&gt;
iManufacturer: 0x01 English (United States) &amp;quot;Hokuyo Data Flex for
USB&amp;quot;&lt;br /&gt;
iProduct: 0x02 English (United States) &amp;quot;URG-Series USB Driver&amp;quot;&lt;br /&gt;
iSerialNumber: 0x00&lt;br /&gt;
bNumConfigurations: 0x01&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Configuration Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x09&lt;br /&gt;
bDescriptorType: 0x02&lt;br /&gt;
wTotalLength: 0x0043 -&amp;gt; Validated&lt;br /&gt;
bNumInterfaces: 0x02&lt;br /&gt;
bConfigurationValue: 0x01&lt;br /&gt;
iConfiguration: 0x00&lt;br /&gt;
bmAttributes: 0xA0 -&amp;gt; Bus Powered&lt;br /&gt;
MaxPower: 0xFA = 500 mA&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Interface Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x09&lt;br /&gt;
bDescriptorType: 0x04&lt;br /&gt;
bInterfaceNumber: 0x00&lt;br /&gt;
bAlternateSetting: 0x00&lt;br /&gt;
bNumEndpoints: 0x01&lt;br /&gt;
bInterfaceClass: 0x02 -&amp;gt; This is Communications (CDC Control) USB
Device Interface Class&lt;br /&gt;
bInterfaceSubClass: 0x02&lt;br /&gt;
bInterfaceProtocol: 0x01&lt;br /&gt;
CAUTION: This may be an invalid bInterfaceProtocol&lt;br /&gt;
iInterface: 0x00 -&amp;gt; This is a Communications (CDC Control) USB
Device Interface Class&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Descriptor Hex Dump&amp;lt;===&lt;br /&gt;
bLength: 0x05&lt;br /&gt;
bDescriptorType: 0x24&lt;br /&gt;
05 24 00 10 01 -&amp;gt; This is a Communications (CDC Control) USB
Device Interface Class&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Descriptor Hex Dump&amp;lt;===&lt;br /&gt;
bLength: 0x04&lt;br /&gt;
bDescriptorType: 0x24&lt;br /&gt;
04 24 02 06 -&amp;gt; This is a Communications (CDC Control) USB Device
Interface Class&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Descriptor Hex Dump&amp;lt;===&lt;br /&gt;
bLength: 0x05&lt;br /&gt;
bDescriptorType: 0x24&lt;br /&gt;
05 24 06 00 01 -&amp;gt; This is a Communications (CDC Control) USB
Device Interface Class&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Descriptor Hex Dump&amp;lt;===&lt;br /&gt;
bLength: 0x05&lt;br /&gt;
bDescriptorType: 0x24&lt;br /&gt;
05 24 01 03 01&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Endpoint Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x07&lt;br /&gt;
bDescriptorType: 0x05&lt;br /&gt;
bEndpointAddress: 0x83 -&amp;gt; Direction: IN - EndpointID: 3&lt;br /&gt;
bmAttributes: 0x03 -&amp;gt; Interrupt Transfer Type&lt;br /&gt;
wMaxPacketSize: 0x0010 = 0x10 bytes&lt;br /&gt;
bInterval: 0x10&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Interface Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x09&lt;br /&gt;
bDescriptorType: 0x04&lt;br /&gt;
bInterfaceNumber: 0x01&lt;br /&gt;
bAlternateSetting: 0x00&lt;br /&gt;
bNumEndpoints: 0x02&lt;br /&gt;
bInterfaceClass: 0x0A -&amp;gt; This is a CDC Data USB Device Interface
Class&lt;br /&gt;
bInterfaceSubClass: 0x00&lt;br /&gt;
bInterfaceProtocol: 0x00&lt;br /&gt;
CAUTION: This may be an invalid bInterfaceProtocol&lt;br /&gt;
iInterface: 0x00&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Endpoint Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x07&lt;br /&gt;
bDescriptorType: 0x05&lt;br /&gt;
bEndpointAddress: 0x02 -&amp;gt; Direction: OUT - EndpointID: 2&lt;br /&gt;
bmAttributes: 0x02 -&amp;gt; Bulk Transfer Type&lt;br /&gt;
wMaxPacketSize: 0x0040 = 0x40 bytes&lt;br /&gt;
bInterval: 0x00&lt;/p&gt;

&lt;p&gt;
===&amp;gt;Endpoint Descriptor&amp;lt;===&lt;br /&gt;
bLength: 0x07&lt;br /&gt;
bDescriptorType: 0x05&lt;br /&gt;
bEndpointAddress: 0x81 -&amp;gt; Direction: IN - EndpointID: 1&lt;br /&gt;
bmAttributes: 0x02 -&amp;gt; Bulk Transfer Type&lt;br /&gt;
wMaxPacketSize: 0x0040 = 0x40 bytes&lt;br /&gt;
bInterval: 0x00&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: STM32: USBH_BulkReceiveData() Usage</title><link>https://community.arm.com/thread/61295?ContentTypeID=1</link><pubDate>Wed, 24 Oct 2012 10:55:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b48cc54f-3894-4754-8a6c-31e7b39b4818</guid><dc:creator>Thomas Kroesswang</dc:creator><description>&lt;p&gt;&lt;p&gt;
I found a nice code example for CDC Host here:&lt;br /&gt;
&lt;a target="_blank" href="http://code.google.com/p/propilot/source/browse/trunk/Microchip/USB/CDC%20Host%20Driver/usb_host_cdc.c?r=75"&gt;code.google.com/.../usb_host_cdc.c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Is it possible that I have to use the requests for Set_Line_Coding
and Set_Control_Line_State before sending/receiving my bulk packets?
If yes, can I send them with USBH_CtlReq() to EP0, right?&lt;/p&gt;

&lt;p&gt;
What is the Set_Control_Line_State request good for? I found it in
the usbcdc11.pdf from usb.org but still don&amp;#39;t really know what its
purpose is.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>