<?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>USB CDC class problem with Windows usbser.sys</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/28879/usb-cdc-class-problem-with-windows-usbser-sys</link><description> 
Hoping to get some expert advice here, 

 
Have an embedded USB application running on a Cortex M4.
Application uses full-speed USB and is based on a Freescale-provided
CDC USB sample project. My bulk &amp;quot;IN&amp;quot; endpoint is defined for 64
bytes. Embedded</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: USB CDC class problem with Windows usbser.sys</title><link>https://community.arm.com/thread/105746?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2012 11:35:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bb69e386-4d91-4e80-b971-8385a0e33546</guid><dc:creator>Gary Kercheck</dc:creator><description>&lt;p&gt;&lt;p&gt;
First of all, thank you for sharing your time and expertise. It is
incredibly helpful to have someone who understand the gory details of
USB to bounce this stuff off of.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt;If you see 192 bytes on USBlyzer, the device sends just 192
bytes (three 64-bytes transactions and ZLP). If this is result of 512
bytes transfer, your firmware still have trouble for 512 bytes
transfer.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I do indeed only see 192 bytes on USBlyzer. Digging a little
deeper, the issue is that the Cortex USB&amp;#39;s SIE does not release the
&amp;quot;OWN&amp;quot; bit after 3 consecutive 64 byte packets. It is possibly waiting
for an ACK that never comes? So the higher level routine is
packetizing correctly, but at the SIE level, the transfer stops at 3
packets. The OWN bit does eventually clear, after a millisecond or
so. I&amp;#39;ve also looked at the DATA0/1 toggle bit and that seems to be
handled correctly.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; OR&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;- Your PC application reads just 192 bytes. Read more.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
I&amp;#39;m thinking this may be the case. I&amp;#39;ve ran this test with both
Tera Term and Hyperterminal and per USBlyzer, they both seem to be
making 4096 byte IN requests. I may try writing a quick VB.net
application and invoking the &amp;quot;SerialPort.WriteBufferSize&amp;quot; call as you
suggest.&lt;/p&gt;

&lt;p&gt;
However, stepping back and looking at the overhead required on the
embedded side, I think a better solution for me is to use the high
speed USB port on the K70 Kinetis processor instead. Even if I do
clear this last hurdle and get 512 byte transactions going, there is
still quite a bit of overhead required to babysit the SIE when you
packetize BULK transfers with USB 1.1. (Not too unlike a UART) For
example, on a Cortex M4 with a 100MHz main core frequency, a single
64 packet write, including waiting for the OWN bit to clear takes
roughly 70 uSec. For my application, this is simply too long.&lt;/p&gt;

&lt;p&gt;
High speed USB should resolve this because I can fire off a
single, 512 byte packet every millisecond. Now I simply have to port
Freescale&amp;#39;s CDC device example from full speed to high speed. Fun.
:)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB CDC class problem with Windows usbser.sys</title><link>https://community.arm.com/thread/91429?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2012 02:55:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:862323b6-7af4-4d13-b1be-32407216224c</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;gt; I&amp;#39;m able to get 192 bytes in a single DATA IN
transaction.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
How many bytes are received by single transfer on USBlyzer
log?&lt;/p&gt;

&lt;p&gt;
If you see 192 bytes on USBlyzer, the device sends just 192 bytes
(three 64-bytes transactions and ZLP). If this is result of 512 bytes
transfer, your firmware still have trouble for 512 bytes
transfer.&lt;/p&gt;

&lt;p&gt;
If you see 512 bytes on USBlyzer, but 192 bytes on PC
application,&lt;br /&gt;
- Increase IN buffer size of usbser.sys by SetupComm( dwOutQueue )
(Win32 API) or SerialPort.WriteBufferSize (.Net)&lt;/p&gt;

&lt;p&gt;
OR&lt;/p&gt;

&lt;p&gt;
- Your PC application reads just 192 bytes. Read more.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; Am I running up against the bandwidth limit of usbser.sys
for full-speed devices?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
No.&lt;br /&gt;
As you said, usbser.sys requests 4 KBytes bulk IN request for every
IN transfer to the host controller (HC). HC handles this request like
other bulk transfers from other device driver. While this transfer is
going on, there is no difference caused by PC device driver. That is,
you should be able to see 18 or 19 full-size (64 bytes) packets/frame
transfer speed on idle bus.&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: USB CDC class problem with Windows usbser.sys</title><link>https://community.arm.com/thread/60375?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2012 16:22:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1e96dc39-ddd2-4a6b-b48e-05a1c9661ed1</guid><dc:creator>Gary Kercheck</dc:creator><description>&lt;p&gt;&lt;p&gt;
UPDATE: Found a part of the problem. My embedded application was
only sending packets 63 bytes long due to some test code. Making them
a full 64 bytes does allow a longer transaction. I&amp;#39;m able to get 192
bytes in a single DATA IN transaction. However, anything larger than
this simply does not show up on the Windows side. This is on a
completely idle USB bus. Am I running up against the bandwidth limit
of usbser.sys for full-speed devices?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>