<?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>FX2 manual NAK a given endpoint</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24743/fx2-manual-nak-a-given-endpoint</link><description> 
Hello, 

 
I have a Cypress FX2 based device with customer firmware. There is
EP6 that is configured as 
AUTOIN=0. The FX2 is itself is configured as 
a slave device with internal master. 
within the poll() loop the code regulary checks 
if the internal</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: FX2 manual NAK a given endpoint</title><link>https://community.arm.com/thread/77150?ContentTypeID=1</link><pubDate>Sat, 14 Feb 2009 04:58:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:46a73e9b-cad6-43ac-b78a-55d7f3e1cf34</guid><dc:creator>Tibor Harsszegi</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hello Tsuneo,&lt;/p&gt;

&lt;p&gt;
thank you for all the suggestions and explanattions.&lt;br /&gt;
Actually I used totalphase&amp;#39;s Beagle (hardware&lt;br /&gt;
analyzer), but neverthless it turned out that I&lt;br /&gt;
was lame enough to not SEE the NAKs themselves,&lt;br /&gt;
they were surely present, the FX2 did it naturally&lt;br /&gt;
all good, automatically.&lt;br /&gt;
Anyhow the driver was a custom amde CyUSB based stuff.&lt;br /&gt;
Thanks again,&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FX2 manual NAK a given endpoint</title><link>https://community.arm.com/thread/55393?ContentTypeID=1</link><pubDate>Thu, 12 Feb 2009 04:34:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:73aef2a5-b471-4b6c-92ed-73f46e8743a0</guid><dc:creator>Tsuneo Chinzei</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;- I would assume that this is done by the SIE autmatically (if
the FIFO is empty, all reads are NAKed), but this is not the case at
all, no NAK is seen by our USB sniffer.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Is it a hardware bus analyzer?&lt;br /&gt;
Software sniffers can&amp;#39;t see NAK on the bus.&lt;br /&gt;
Just hardware bus analyzer can observe it.&lt;/p&gt;

&lt;p&gt;
NAK handling is completed on the PC hardware - host controller. PC
device driver has no chance to play with it. As software sniffers
watches the traffic between the device drivers, system and top-most
one, NAK is not leaked out to software sniffers.&lt;/p&gt;

&lt;p&gt;
On the firmware side,&lt;br /&gt;
The endpoint automatically sends NAK, when no data is loaded to it.
As you described, put the status data to the endpoint buffer, just
when the data is ready. While no data is available, just leave the
endpoint alone; load nothing.&lt;/p&gt;

&lt;p&gt;
On the host side,&lt;br /&gt;
What is the device driver? HID, CyUSB or WinUSB ?&lt;br /&gt;
There are two types of device driver, with or without read-ahead.&lt;/p&gt;

&lt;p&gt;
HID has a read-ahead input buffer on the device driver; it
periodically sends IN transaction to the device, without any help of
PC app. The data sent by the device is stored on the device driver
buffer (cyclic buffer). The host app reads out the data from this
buffer.&lt;/p&gt;

&lt;p&gt;
CyUSB and WinUSB are generic device driver. The IN transactions
start by the host app, such as WinUSB_ReadPipe call. While the device
is NAKing, the read call doesn&amp;#39;t finish. Then, you have to apply
asynchronous (OVERLAPPED) call, so as to do other tasks on the other
threads. When the read call finishes, IN transactions also stop on
the bus. To keep the IN transactions, the host app has to issue
another read call, immediately after the last call finishes.&lt;/p&gt;

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