<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: FX2 CyStream throughput test with SDCC and fx2lib</title>
	<atom:link href="http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/feed/" rel="self" type="application/rss+xml" />
	<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/</link>
	<description>Where stuff from my brain lands</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:14:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kurt</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1152</link>
		<dc:creator>Kurt</dc:creator>
		<pubDate>Mon, 14 Feb 2011 09:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1152</guid>
		<description>look great. thanks your sharing.</description>
		<content:encoded><![CDATA[<p>look great. thanks your sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1091</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Fri, 01 Oct 2010 06:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1091</guid>
		<description>I&#039;ve been out of the country and just got back.  Thanx for the pointers and I&#039;ll check out nitro and see if it can help.

Also, I went to ubixum.com.  Am I missing something as I do not see any products, etc.?   

I joined the mailing list.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been out of the country and just got back.  Thanx for the pointers and I&#8217;ll check out nitro and see if it can help.</p>
<p>Also, I went to ubixum.com.  Am I missing something as I do not see any products, etc.?   </p>
<p>I joined the mailing list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1084</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Wed, 08 Sep 2010 12:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1084</guid>
		<description>No problem.  The driver included is a bit of a sample driver.  It works for testing but probably isn&#039;t going to get anyone anywhere too fast on a real project.  Ubixum released a driver that works on both windows and Linux:

http://github.com/ubixum/nitro
Also, a couple firmwares for various projects we did.
http://github.com/ubixum

In addition to the basic USB connectivity, that firmware provides a convenient way to map hardware addresses to a human readable terminal/register structure that you can get and set values from.  We then built our software on top of that.

Anyway, Best way to contribute changes is to create a github repo with a fork of fx2lib and then commit the changes and submit a change request that I can pull. 

Also, consider joining the &lt;a href=&quot;http://sourceforge.net/mailarchive/forum.php?forum_name=fx2lib-devel&quot; rel=&quot;nofollow&quot;&gt;fx2lib mailing list&lt;/a&gt;

Thanks for your interest!</description>
		<content:encoded><![CDATA[<p>No problem.  The driver included is a bit of a sample driver.  It works for testing but probably isn&#8217;t going to get anyone anywhere too fast on a real project.  Ubixum released a driver that works on both windows and Linux:</p>
<p><a href="http://github.com/ubixum/nitro" rel="nofollow">http://github.com/ubixum/nitro</a><br />
Also, a couple firmwares for various projects we did.<br />
<a href="http://github.com/ubixum" rel="nofollow">http://github.com/ubixum</a></p>
<p>In addition to the basic USB connectivity, that firmware provides a convenient way to map hardware addresses to a human readable terminal/register structure that you can get and set values from.  We then built our software on top of that.</p>
<p>Anyway, Best way to contribute changes is to create a github repo with a fork of fx2lib and then commit the changes and submit a change request that I can pull. </p>
<p>Also, consider joining the <a href="http://sourceforge.net/mailarchive/forum.php?forum_name=fx2lib-devel" rel="nofollow">fx2lib mailing list</a></p>
<p>Thanks for your interest!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1083</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Sun, 05 Sep 2010 06:19:53 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1083</guid>
		<description>Sorry for the above, I noticed the indentation didn&#039;t stay.</description>
		<content:encoded><![CDATA[<p>Sorry for the above, I noticed the indentation didn&#8217;t stay.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1082</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Sun, 05 Sep 2010 06:18:44 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1082</guid>
		<description>I think I have the latest copy of fx2lib as I used github to download just a few days ago.  I had to fix the fx2/cpp files to work under Ubuntu 10.04 as follows:

void 
fx2::open(int vid, int pid, int idx) {
    libusb_device **list;
    int devices = libusb_get_device_list(libusb_ctx, &amp;list);
    int cur_idx = 0;
    for (int i = 0; i &lt; devices; ++i) {
	libusb_device_descriptor dscr;
	if (!libusb_get_device_descriptor(list[i], &amp;dscr) ) {
	    if (dscr.idVendor == vid &amp;&amp; dscr.idProduct == pid) {
		if (idx == cur_idx++ ) {
		    int rv = libusb_open(list[i], &amp;dev_handle);
		    if (!rv) {
			if (libusb_kernel_driver_active(dev_handle, 0)) {
			    // Probably should re-attach, but we don&#039;t!!!
			    libusb_detach_kernel_driver(dev_handle, 0);
			}
			rv = libusb_claim_interface(dev_handle, 0);
			if (!rv) {
			    interface = 0;
			    rv = libusb_set_interface_alt_setting(dev_handle,
								  0, 0);
			    if (rv) {
				libusb_close(dev_handle);
				dev_handle = NULL;
			    }
			    alt_setting=0;
			} else {
			    libusb_close(dev_handle);
			    dev_handle=NULL;
			}
		    } else {
			printf ( &quot;Unable to open device idx: %d, ret: %d\n&quot;, 
				 idx, rv );
		    }
		}
	    }
	}
    }
    
    if (!dev_handle) {
        printf ( &quot;Device not opened.\n&quot; );
    }
    libusb_free_device_list(list,1);
}


The change I made was the libusb_kernel_driver_active if statement that finally does libusb_detach_kernel_driver function.  I haven&#039;t tried this solution in any other context, so it may not be general.

Does this change make sense?</description>
		<content:encoded><![CDATA[<p>I think I have the latest copy of fx2lib as I used github to download just a few days ago.  I had to fix the fx2/cpp files to work under Ubuntu 10.04 as follows:</p>
<p>void<br />
fx2::open(int vid, int pid, int idx) {<br />
    libusb_device **list;<br />
    int devices = libusb_get_device_list(libusb_ctx, &amp;list);<br />
    int cur_idx = 0;<br />
    for (int i = 0; i &lt; devices; ++i) {<br />
	libusb_device_descriptor dscr;<br />
	if (!libusb_get_device_descriptor(list[i], &amp;dscr) ) {<br />
	    if (dscr.idVendor == vid &amp;&amp; dscr.idProduct == pid) {<br />
		if (idx == cur_idx++ ) {<br />
		    int rv = libusb_open(list[i], &amp;dev_handle);<br />
		    if (!rv) {<br />
			if (libusb_kernel_driver_active(dev_handle, 0)) {<br />
			    // Probably should re-attach, but we don&#039;t!!!<br />
			    libusb_detach_kernel_driver(dev_handle, 0);<br />
			}<br />
			rv = libusb_claim_interface(dev_handle, 0);<br />
			if (!rv) {<br />
			    interface = 0;<br />
			    rv = libusb_set_interface_alt_setting(dev_handle,<br />
								  0, 0);<br />
			    if (rv) {<br />
				libusb_close(dev_handle);<br />
				dev_handle = NULL;<br />
			    }<br />
			    alt_setting=0;<br />
			} else {<br />
			    libusb_close(dev_handle);<br />
			    dev_handle=NULL;<br />
			}<br />
		    } else {<br />
			printf ( &quot;Unable to open device idx: %d, ret: %d\n&quot;,<br />
				 idx, rv );<br />
		    }<br />
		}<br />
	    }<br />
	}<br />
    }</p>
<p>    if (!dev_handle) {<br />
        printf ( &quot;Device not opened.\n&quot; );<br />
    }<br />
    libusb_free_device_list(list,1);<br />
}</p>
<p>The change I made was the libusb_kernel_driver_active if statement that finally does libusb_detach_kernel_driver function.  I haven&#039;t tried this solution in any other context, so it may not be general.</p>
<p>Does this change make sense?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1033</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Thu, 25 Mar 2010 15:47:49 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1033</guid>
		<description>Glad it&#039;s working.  If you haven&#039;t already, you&#039;ll probably want to download fx2lib from the latest github master as opposed to 0.1  There are quite a few fixes, new samples, better build system and other things.  I&#039;m about ready to tag it 0.2 but I&#039;ve been waiting on giving it a new website/home.</description>
		<content:encoded><![CDATA[<p>Glad it&#8217;s working.  If you haven&#8217;t already, you&#8217;ll probably want to download fx2lib from the latest github master as opposed to 0.1  There are quite a few fixes, new samples, better build system and other things.  I&#8217;m about ready to tag it 0.2 but I&#8217;ve been waiting on giving it a new website/home.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joebre</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1032</link>
		<dc:creator>joebre</dc:creator>
		<pubDate>Thu, 25 Mar 2010 05:17:06 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1032</guid>
		<description>Sorry, I did a mistake... in the EProm image I got the old version of fw.c, this explains what I was seeing. Using your fw.c the throughput goes immediately and stably up to 43 MB/s. Thanks again for your support.

Job</description>
		<content:encoded><![CDATA[<p>Sorry, I did a mistake&#8230; in the EProm image I got the old version of fw.c, this explains what I was seeing. Using your fw.c the throughput goes immediately and stably up to 43 MB/s. Thanks again for your support.</p>
<p>Job</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joebre</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1031</link>
		<dc:creator>joebre</dc:creator>
		<pubDate>Thu, 25 Mar 2010 04:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1031</guid>
		<description>Hi, thanks for your rapid answer.
I used your code as it comes from your web site, which I suppose has already the changes you&#039;re speaking about (correct?). Yes I tried on several machines both Vista and XP and the throughput seems kind of hardwired to a maximum of 35/36 MB/S. You are right at the end I&#039;ll use a synchronous slave fifo approach. At this stage of the project I need just to get a list of requirements for the host and to validate the throughput for Bulk unidirectional transfers (IN). 36 MB/s is good but it gives me a really small margin.</description>
		<content:encoded><![CDATA[<p>Hi, thanks for your rapid answer.<br />
I used your code as it comes from your web site, which I suppose has already the changes you&#8217;re speaking about (correct?). Yes I tried on several machines both Vista and XP and the throughput seems kind of hardwired to a maximum of 35/36 MB/S. You are right at the end I&#8217;ll use a synchronous slave fifo approach. At this stage of the project I need just to get a list of requirements for the host and to validate the throughput for Bulk unidirectional transfers (IN). 36 MB/s is good but it gives me a really small margin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1030</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Wed, 24 Mar 2010 15:41:46 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1030</guid>
		<description>Been a while since I tried.  Is there much different about streamer.exe and CyStream?  I got it to go faster by eliminating any work the firmware was doing that wasn&#039;t involved with committing the packets.  Did you make those changes?

It&#039;s a good learning activity to see how fast you can get it to go, but in the end, you&#039;ll probably use slave fifo or gpif to transfer data from a peripheral directly through the buffers to the PC.  We do this at 43MB/s which seems about as fast as the host will handle it. 

Lastly, have you tried more than one machine to see if you get different results?  You can post messages and firmware bits to the fx2lib mailing list too by the way: http://bit.ly/9xj8M5</description>
		<content:encoded><![CDATA[<p>Been a while since I tried.  Is there much different about streamer.exe and CyStream?  I got it to go faster by eliminating any work the firmware was doing that wasn&#8217;t involved with committing the packets.  Did you make those changes?</p>
<p>It&#8217;s a good learning activity to see how fast you can get it to go, but in the end, you&#8217;ll probably use slave fifo or gpif to transfer data from a peripheral directly through the buffers to the PC.  We do this at 43MB/s which seems about as fast as the host will handle it. </p>
<p>Lastly, have you tried more than one machine to see if you get different results?  You can post messages and firmware bits to the fx2lib mailing list too by the way: <a href="http://bit.ly/9xj8M5" rel="nofollow">http://bit.ly/9xj8M5</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joebre</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-1029</link>
		<dc:creator>joebre</dc:creator>
		<pubDate>Wed, 24 Mar 2010 15:31:32 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-1029</guid>
		<description>Hi, first of all great job ! 
Just a question... I built your cystream using the latest FX2Lib, I programmed the binary into the EPROM of my custom EZ-USB board. Everything worked well at the first trial. Now the question... when I use your firmware in conjunction with the Streamer.exe delivered by Cypress I only get up tu a maximum of 36 MB/s in bulk mode which is quite far from the results you got. I’ve a IHC9 as host controller which should guarantee the maximum bandwidth... Where do you think is the problem? did you ever tried to use Streamer.exe of Cypress? with which results ?
Thanks Joebre</description>
		<content:encoded><![CDATA[<p>Hi, first of all great job !<br />
Just a question&#8230; I built your cystream using the latest FX2Lib, I programmed the binary into the EPROM of my custom EZ-USB board. Everything worked well at the first trial. Now the question&#8230; when I use your firmware in conjunction with the Streamer.exe delivered by Cypress I only get up tu a maximum of 36 MB/s in bulk mode which is quite far from the results you got. I’ve a IHC9 as host controller which should guarantee the maximum bandwidth&#8230; Where do you think is the problem? did you ever tried to use Streamer.exe of Cypress? with which results ?<br />
Thanks Joebre</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-910</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Thu, 02 Jul 2009 15:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-910</guid>
		<description>The fx2load package has some example of talking to the device with libusb-1.0.  You can see sending vendor commands and doing bulk reads.   I use that in the speed.py file too.  Really though, everyone&#039;s device is different so I haven&#039;t found much utility in adding a host side example.  Perhaps I&#039;ll add a CyStream C++ equivalent that uses libusb0 one of these days.</description>
		<content:encoded><![CDATA[<p>The fx2load package has some example of talking to the device with libusb-1.0.  You can see sending vendor commands and doing bulk reads.   I use that in the speed.py file too.  Really though, everyone&#8217;s device is different so I haven&#8217;t found much utility in adding a host side example.  Perhaps I&#8217;ll add a CyStream C++ equivalent that uses libusb0 one of these days.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bali.asur</title>
		<link>http://allmybrain.com/2009/04/14/fx2-cystream-throughput-test-with-sdcc-and-fx2lib/comment-page-1/#comment-907</link>
		<dc:creator>bali.asur</dc:creator>
		<pubDate>Thu, 02 Jul 2009 11:37:52 +0000</pubDate>
		<guid isPermaLink="false">http://allmybrain.com/?p=261#comment-907</guid>
		<description>Dennis:

Do you have any samples of your host application side
code?

Regards,

bali</description>
		<content:encoded><![CDATA[<p>Dennis:</p>
<p>Do you have any samples of your host application side<br />
code?</p>
<p>Regards,</p>
<p>bali</p>
]]></content:encoded>
	</item>
</channel>
</rss>

