<?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: Program stops running when I unplug USB cable?</title>
		<link>http://forums.leaflabs.com/topic.php?id=1325</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:21:14 +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=1325" rel="self" type="application/rss+xml" />

		<item>
			<title>DIYDSP on "Program stops running when I unplug USB cable?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1325#post-8175</link>
			<pubDate>Mon, 13 Feb 2012 14:22:37 +0000</pubDate>
			<dc:creator>DIYDSP</dc:creator>
			<guid isPermaLink="false">8175@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hey, thanks gbulmer!&#60;/p&#62;
&#60;p&#62;I tried the blink program and it works fine with unplugging the USB cable.  It seems the AudioCodecShield library does something special that collides with the USB.  &#60;/p&#62;
&#60;p&#62;NOW FOR THE REALLY GOOD NEWS!  &#34;Guest&#34; of Open Music Labs sent me a fix which I'll post here.  It disables USB interrupts on the Maple.  Previously, I had used &#34;SerialUSB.end();&#34; but I don't think it goes far enough.  (it probably only tears down the serial port, not the whole interface).&#60;/p&#62;
&#60;p&#62;Here's an improvement from guest that you can call inside setup();&#60;br /&#62;
  nvic_irq_disable(NVIC_USB_LP_CAN_RX0);    // note, you must include &#34;nvic.h&#34; &#60;/p&#62;
&#60;p&#62;This is working great for me!  And my device also boots into the correct program.  Note of course, that with USB disabled, you have to manually reset your Maple to upload a new program. That's not an obstacle for me :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "Program stops running when I unplug USB cable?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1325#post-8156</link>
			<pubDate>Thu, 09 Feb 2012 23:21:11 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">8156@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Have you checked that the Maple IDE is loading a simple program into Flash correctly?&#60;br /&#62;
Load 'Blink' using exactly the same settings as the guitar distortion program.&#60;br /&#62;
When you unplug that, and then repower, does it still blink? It should work.&#60;/p&#62;
&#60;p&#62;The Maple changes its USB identity, some times it is a DFU device, and sometimes a serial device. The DISC signal is used to pull-up or drop the USB D+ pin. That is a signal to the host PC to re-enumerate (re-query) the Maple to find out what type of USB it is. There are two transistors between the pn and USB so that is unlkely to inject a glitch into the Maple.&#60;/p&#62;
&#60;p&#62;BTW - What version is the Maple IDE and what is the host PC Operating System?&#60;/p&#62;
&#60;p&#62;(Full disclosure: I am not a member of LeafLabs staff.)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>DIYDSP on "Program stops running when I unplug USB cable?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1325#post-8152</link>
			<pubDate>Thu, 09 Feb 2012 21:36:39 +0000</pubDate>
			<dc:creator>DIYDSP</dc:creator>
			<guid isPermaLink="false">8152@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi all!  Just want to say I love this platform and I'm having a blast learning to program it!  &#60;/p&#62;
&#60;p&#62;I am using a Maple R3 with the power jumper on &#34;EXT&#34; and the CHRG jumper is off.  I'm running from an external 9VDC bench supply into the barrel connector.  When I upload from Maple IDE, my board is set to &#34;Leaflabs Maple Rev 3+ to Flash.&#34;&#60;/p&#62;
&#60;p&#62;Now my problem is that when I am running my program (a guitar distortion algorithm using the AudioCodecShield), everything is hunky-dory until I unplug my USB cable...   Then, the sound stops!  And when I re-boot my Maple, the program doesn't start up and make sound unless the USB cable is plugged in!  How can I make this board boot up into the software I flashed onto it from the Maple IDE, even when it's not tethered to my laptop?&#60;/p&#62;
&#60;p&#62;From what I can see in the schematic, removing the USB cable shouldn't matter tooo much...  But I don't fully understand the function of the DISC pin???  Is it pulling up the D+ signal?  Could it be that when I unplug the USB cable, there's a glitch on the USB bus that ruins everything?  I did try an experiment where I turn off the USB in software, so hopefully that shouldn't matter.  &#60;/p&#62;
&#60;p&#62;Any ideas?  and sorry if this is a n00b question, I did search the form archives and the wiki, but couldn't find the answer!   Thank you!&#60;/p&#62;
&#60;p&#62;-DIYDSP (Noah)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
