<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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">
	<channel>
		<title>LeafLabs Garden &#187; Topic: race condition in usb.c ?</title>
		<link>http://forums.leaflabs.com/topic.php?id=645</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:20:01 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=645" rel="self" type="application/rss+xml" />

		<item>
			<title>mbolivar on "race condition in usb.c ?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=645#post-3595</link>
			<pubDate>Thu, 10 Feb 2011 11:24:09 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">3595@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi Stephen,&#60;/p&#62;
&#60;p&#62;If you find a bug, you can choose any of the following methods to report it:&#60;/p&#62;
&#60;p&#62;1) Make a forum post.&#60;/p&#62;
&#60;p&#62;2) If you have a Google account, post an issue in our bugtracker:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://code.google.com/p/leaflabs/issues/list&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/leaflabs/issues/list&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;3) If you have a Github account, comment on the line of source you believe to be in error, and we'll see it on our Github dashboard.&#60;/p&#62;
&#60;p&#62;4) Email &#60;a href=&#34;mailto:bugs@leaflabs.com&#34;&#62;bugs@leaflabs.com&#60;/a&#62; (which I've just created).&#60;/p&#62;
&#60;p&#62;Regarding your question about replacing usb.c, you should be able to make this change in the 0.0.9 IDE release without breaking libmaple 0.0.9.  Your use of the word &#34;dependency&#34; is correct here; there haven't been any changes in usb.c's dependencies which would cause geoffreymbrown's patch to break if applied to 0.0.9.  However, it is unlikely to solve your problems with SerialUSB.&#60;/p&#62;
&#60;p&#62;There are a variety of fixes we've made to the SerialUSB code which should improve its stability significantly.  These occurred in the debug-serialusb libmaple branch, which will be merged into the master branch by the end of the week.  &#60;/p&#62;
&#60;p&#62;At that time, we'll put together &#34;snapshot&#34; releases of the IDE (not a full release, more like a preview) containing the new libmaple code, so IDE users can try it out, instead of just the users of the Unix toolchain.  We've recently spent some time automating the production of IDE snapshots, and we plan on releasing one any time we add any important new features or bugfixes, in order to let the community try them out (and hopefully provide feedback).&#60;/p&#62;
&#60;p&#62;Expect a forum post when it's done, and we look forward to your feedback!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "race condition in usb.c ?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=645#post-3592</link>
			<pubDate>Thu, 10 Feb 2011 09:59:13 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">3592@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Geoffrey, thanks for catching the usb.c bug.&#60;/p&#62;
&#60;p&#62;Is there a place where users can find or upload code which reveals Maple software bugs?  This might be one way to test the Maple IDE before each release.&#60;/p&#62;
&#60;p&#62;If someone wrote some simple code using Maple 0.0.9 (using the unmodified usb.c code) which would show the race (which Geoffrey said he did not observe) this could be added to the &#34;test code&#34; library.&#60;/p&#62;
&#60;p&#62;I am interested in seeing if the change in usb.c makes my sketches which use SerialUSB() more stable.&#60;/p&#62;
&#60;p&#62;Besides replacing (of course after backing up the original files) usb.c which other files should I replace?&#60;/p&#62;
&#60;p&#62;In other words, since the last release of the maple IDE, were there any changes in other files which are required for the most current usb.c code to work.  And of course, are there any recent changes in the most current usb.c code which required modifications in other files.&#60;/p&#62;
&#60;p&#62;Is this is called &#34;dependency&#34;?&#60;/p&#62;
&#60;p&#62;Or I could wait until the next IDE release if it is coming out soon.  Any date?&#60;/p&#62;
&#60;p&#62;Thanks for the hard work!&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "race condition in usb.c ?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=645#post-3580</link>
			<pubDate>Wed, 09 Feb 2011 18:00:53 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">3580@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Fixed, thanks!&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/leaflabs/libmaple/commit/d0074d2922de87d08745c99665ae6590933d1e94&#34; rel=&#34;nofollow&#34;&#62;https://github.com/leaflabs/libmaple/commit/d0074d2922de87d08745c99665ae6590933d1e94&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>geoffreymbrown on "race condition in usb.c ?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=645#post-3577</link>
			<pubDate>Wed, 09 Feb 2011 15:03:36 +0000</pubDate>
			<dc:creator>geoffreymbrown</dc:creator>
			<guid isPermaLink="false">3577@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The following code is from libmaple/usb/usb.c line 376&#60;/p&#62;
&#60;p&#62; if (loaded) {&#60;br /&#62;
    UserToPMABufferCopy(sendBuf,VCOM_TX_ADDR + countTx, loaded);&#60;br /&#62;
    _SetEPTxCount(VCOM_TX_ENDP, countTx+loaded);&#60;br /&#62;
    _SetEPTxValid(VCOM_TX_ENDP);&#60;br /&#62;
    countTx += loaded;&#60;br /&#62;
  }&#60;/p&#62;
&#60;p&#62;Seems like there's a race condition on countTx and the code&#60;br /&#62;
should be:&#60;/p&#62;
&#60;p&#62;if (loaded) {&#60;br /&#62;
    UserToPMABufferCopy(sendBuf,VCOM_TX_ADDR + countTx, loaded);&#60;br /&#62;
    _SetEPTxCount(VCOM_TX_ENDP, countTx+loaded);&#60;br /&#62;
    countTx += loaded;&#60;br /&#62;
    _SetEPTxValid(VCOM_TX_ENDP);&#60;/p&#62;
&#60;p&#62;  }&#60;/p&#62;
&#60;p&#62;I haven't seen a race, just seems like there might be one.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
