<?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: flash upload problem in Eclipse</title>
		<link>http://forums.leaflabs.com/topic.php?id=1247</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:28:04 +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=1247" rel="self" type="application/rss+xml" />

		<item>
			<title>josefkoller on "flash upload problem in Eclipse"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1247#post-7471</link>
			<pubDate>Thu, 29 Dec 2011 03:14:52 +0000</pubDate>
			<dc:creator>josefkoller</dc:creator>
			<guid isPermaLink="false">7471@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I love the libmaple design but i love virtualization too.&#60;br /&#62;
My installation look like this:&#60;br /&#62;
- ubuntu 11.04 64-bit&#60;br /&#62;
- vmware and as guest ubuntu 32bit&#60;br /&#62;
and the maple specific stuff&#60;br /&#62;
- toolchain with this instructions &#60;a href=&#34;http://leaflabs.com/docs/unix-toolchain.html#toolchain-udev&#34; rel=&#34;nofollow&#34;&#62;http://leaflabs.com/docs/unix-toolchain.html#toolchain-udev&#60;/a&#62;&#60;br /&#62;
- eclipse   with the instruction from &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=681&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=681&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The problem is, i never could upload a file. In the full package from the maple-IDE the upload works fine.&#60;/p&#62;
&#60;p&#62;The problem was in the make file :&#60;br /&#62;
 $(SUPPORT_PATH)/scripts/reset.py &#38;amp;&#38;amp; \&#60;br /&#62;
 sleep 1                  &#38;amp;&#38;amp; \&#60;br /&#62;
 $(DFU) -a1 -d $(VENDOR_ID):$(PRODUCT_ID) -D $(BUILD_PATH)/$(BOARD).bin -R&#60;/p&#62;
&#60;p&#62;The timing between &#34;reset.py&#34; and &#34;dfu-util&#34; is wrong. Maybe a problem from virtualization. Never mind i did the following for a solution.&#60;br /&#62;
I wrote a little wrapper around the DFU-UTIL.&#60;/p&#62;
&#60;p&#62;1) update the file &#34;libmaple/support/make/build-rules.mk&#34;&#60;br /&#62;
   original: &#34;DFU      := dfu-util&#34;&#60;br /&#62;
   my one  : &#34;DFU      := dfu-util-wrap.sh&#34;&#60;/p&#62;
&#60;p&#62;2) After that copy the following bash script into the directory &#34;libmaple/arm/bin&#34;&#60;/p&#62;
&#60;p&#62;bash-script &#34;dfu-util.wrap.sh&#34;&#60;br /&#62;
Copy only the source between the dashes.&#60;br /&#62;
Do not forget and make the file executable.&#60;br /&#62;
Hope it helps.&#60;br /&#62;
If you like, you can reduce the &#34;sleep 1&#34; to &#34;sleep 0&#34; in the make file.&#60;br /&#62;
--------------------------------&#60;br /&#62;
#!/bin/bash&#60;br /&#62;
#title: wraper for dfu-util&#60;br /&#62;
#autor: josef koller (vienna)&#60;br /&#62;
#date : Dec. 2011&#60;br /&#62;
#reason: the dfu-util ist not synchroniced by firmeware uploads&#60;br /&#62;
#        so a simple retry mechanism is built in&#60;br /&#62;
#parms: all parms are passsed to &#34;dfu-util&#34;&#60;/p&#62;
&#60;p&#62;rc=&#34;&#34;&#60;br /&#62;
count=0&#60;br /&#62;
while [ &#34;$rc&#34; == &#34;&#34; ]&#60;br /&#62;
do&#60;br /&#62;
 count=$((count+1))&#60;br /&#62;
 if [ $count -gt 399 ]; then&#60;br /&#62;
  echo &#34;Could not upload the file after $count retries&#34;&#60;br /&#62;
  break&#60;br /&#62;
 fi&#60;br /&#62;
 echo -n -e &#34;Try the upload. Lap $count.\r&#34;&#60;/p&#62;
&#60;p&#62; res=&#60;code&#62;dfu-util $1 $2 $3 $4 $5 $6 $7 $8 $9 2&#38;gt; /dev/null&#60;/code&#62;&#60;br /&#62;
 rc=&#60;code&#62;echo $res &#124; grep &#38;#39;Done!&#38;#39;&#60;/code&#62;&#60;br /&#62;
done &#60;/p&#62;
&#60;p&#62;echo $res&#60;br /&#62;
--------------------------------
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
