<?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: Having problems with C# emitResetPulse()</title>
		<link>http://forums.leaflabs.com/topic.php?id=13449</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:05: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=13449" rel="self" type="application/rss+xml" />

		<item>
			<title>ala42 on "Having problems with C# emitResetPulse()"</title>
			<link>http://forums.leaflabs.com/topic.php?id=13449#post-28613</link>
			<pubDate>Thu, 29 Aug 2013 18:37:15 +0000</pubDate>
			<dc:creator>ala42</dc:creator>
			<guid isPermaLink="false">28613@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The baud rate on the virtual com port does not matter.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>visualmicro2 on "Having problems with C# emitResetPulse()"</title>
			<link>http://forums.leaflabs.com/topic.php?id=13449#post-28609</link>
			<pubDate>Thu, 29 Aug 2013 16:54:42 +0000</pubDate>
			<dc:creator>visualmicro2</dc:creator>
			<guid isPermaLink="false">28609@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Ignore the comment about the reset button failing. It was my test app that thought the port wan't coming back up after pressing reset.&#60;/p&#62;
&#60;p&#62;So it's really just that I am too stupid to work out how to properly send the proper DTR / &#34;1EAF&#34; to the port as ASCII :) &#60;/p&#62;
&#60;p&#62;Am I right in thinking the 1EAF needs to be sent at 115200 baud?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>visualmicro2 on "Having problems with C# emitResetPulse()"</title>
			<link>http://forums.leaflabs.com/topic.php?id=13449#post-28608</link>
			<pubDate>Thu, 29 Aug 2013 16:45:37 +0000</pubDate>
			<dc:creator>visualmicro2</dc:creator>
			<guid isPermaLink="false">28608@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks for the replies. Yes I agree the port will be closed after the reset code has completed. &#60;/p&#62;
&#60;p&#62;The c# code is having no problems finding the device with dfu-util when in manual/perpetual bootloader mode, or with normal serial&#38;gt;SerialUSB. (Yes thanks, I realize it can take a few seconds for the device to transition in and then out of dfu mode.&#60;/p&#62;
&#60;p&#62;After investigating some more it appears the maple is left in some strange state after writing the DTR / &#34;1EAF&#34; to the board. After writing 1EAF, the usb com port disappears as expected but the board is not found by dfu-util and the reset button fails to cause the board to reboot and subsequently appear as a serial usb device (after a few secs). &#60;/p&#62;
&#60;p&#62;After writing 1EAF, the only way to restore the board to a working state is to disconnect the usb for a few seconds then reconnect. It seems like the 1EAF is doing something but not everything :)&#60;/p&#62;
&#60;p&#62;Uggh, thanks for any help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Having problems with C# emitResetPulse()"</title>
			<link>http://forums.leaflabs.com/topic.php?id=13449#post-28573</link>
			<pubDate>Tue, 27 Aug 2013 11:51:00 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">28573@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;visualmicro2 - What OS are you using, Windows?&#60;/p&#62;
&#60;p&#62;When you reset the board, the USB port stops being a USB serial device, and is a USB DFU device.&#60;br /&#62;
So I would expect the serial port to &#34;lock up&#34; because there is no longer a device there, and AFAIK, an OS, e.g. Windows, will take a little bit of time to notice. &#60;/p&#62;
&#60;p&#62;Further, on Windows, the serial port will be a different COM port when the Maple returns from being a DFU device. So I wouldn't expect to be able to talk to it as the same device (on Windows).&#60;/p&#62;
&#60;p&#62;After the board is reset, you could open it as a DFU device, and upload.&#60;/p&#62;
&#60;p&#62;So, I believe you will need to close the serialPort after you've done the reset and &#60;code&#62;serialPort.Write(&#38;quot;1EAF&#38;quot;);&#60;/code&#62;. Then find the port again (a different COM on Windows) if you want to talk to the board.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mlundinse on "Having problems with C# emitResetPulse()"</title>
			<link>http://forums.leaflabs.com/topic.php?id=13449#post-28572</link>
			<pubDate>Tue, 27 Aug 2013 11:47:07 +0000</pubDate>
			<dc:creator>mlundinse</dc:creator>
			<guid isPermaLink="false">28572@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;After the reset sequence the Maple USB is no longer a serial device but a dfu device. So your C# serial connection will get cut off, and this happens without your program closing the serial port. Then a few seconds later, if you have a working sketch on your board, the dfu bootloader will start the sketch and the USB Serial port will reappear.&#60;/p&#62;
&#60;p&#62;Regards&#60;br /&#62;
Magnus
&#60;/p&#62;</description>
		</item>
		<item>
			<title>visualmicro2 on "Having problems with C# emitResetPulse()"</title>
			<link>http://forums.leaflabs.com/topic.php?id=13449#post-28569</link>
			<pubDate>Tue, 27 Aug 2013 11:29:48 +0000</pubDate>
			<dc:creator>visualmicro2</dc:creator>
			<guid isPermaLink="false">28569@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Can anyone help please. I am trying to replicate resetting to the bootloader using serial on a Rev3 board. Dfu works fine if I manually reset, maple uploads fine but I can't get a C# program to replicate the serial reset.&#60;/p&#62;
&#60;p&#62;I have an open serial port at 115200 baud, but when I attempt to reset the serial port &#34;locks up&#34; after writing 1EAF and does not work until the board has been reset. &#60;/p&#62;
&#60;p&#62;Interestingly the port still shows as being available after the reset fails but is unusable. I have tried various combinations, the default delay in the maple code is 50ms but have tried various shorted or longer delays.&#60;/p&#62;
&#60;p&#62;   ` serialPort.BaudRate = 115200;&#60;/p&#62;
&#60;p&#62;                // try to toggle DTR/RTS (old scheme)&#60;br /&#62;
                serialPort.RtsEnable = false;&#60;br /&#62;
                serialPort.DtrEnable = false;&#60;br /&#62;
                serialPort.DtrEnable = true;&#60;/p&#62;
&#60;p&#62;                Thread.Sleep(idelay);&#60;/p&#62;
&#60;p&#62;                serialPort.DtrEnable = false;&#60;/p&#62;
&#60;p&#62;                // try magic number&#60;br /&#62;
                serialPort.RtsEnable = true;&#60;br /&#62;
                serialPort.DtrEnable = true;&#60;br /&#62;
                Thread.Sleep(idelay);&#60;/p&#62;
&#60;p&#62;                serialPort.DtrEnable = false;&#60;/p&#62;
&#60;p&#62;                Thread.Sleep(idelay);&#60;/p&#62;
&#60;p&#62;                serialPort.Write(&#34;1EAF&#34;);&#60;/p&#62;
&#60;p&#62;                //Thread.Sleep(idelay);&#60;/p&#62;
&#60;p&#62;Thanks&#60;/p&#62;
&#60;p&#62;Tim&#60;br /&#62;
`
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
