<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Debug and old IRQ</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12292/debug-and-old-irq</link><description>Hello,
When I restart my application with debugger, i have strange IRQs called (TWI, ...) before init. Possibly IRQ still active and debug don&amp;#39;t touch them. 
 Can I disable all IRQ on restart ? Is there a magic cleaning function ? :-)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Mar 2016 12:01:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12292/debug-and-old-irq" /><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46472?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 12:01:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2fef6ed-98e3-4df0-acd9-48c7de673d2a</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;chip was broken with __disable_irq();
finally i changed the chip on my board&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46471?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 10:25:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05cc1267-1175-4ccb-bed3-e59058174769</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I still do not understand why the chip is bricked? debugger accessing chip from SWD is a different thing. I think there is a reset happening at the early phase of your startup, so your chip is in infinite loop of reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46470?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 21:03:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc044527-24fc-4be7-8171-7a97d99ae351</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;I did that because when a peripheral is working and debugger restart application you get some unexpected irq (end of started DMA xfer) and application crash. With that lines, no more issue, debug by nRF52 DK is stable in my case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46469?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 19:35:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f26422e6-4d74-486b-95cb-5141f38f7634</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Why did you do that???? We were talking about disabling peripheral interrupts and not using __disable_irq because it was disabling SVC exception also. Clearing all bits in ICER register means everything except reset, NMI and hardfault are disabled. This is out of my knowledge of to what debugger needs to halt the CPU here. I will talk to few other guys here tomorrow and see if there is any possibility to unbrick your device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46468?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 12:16:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ba9a667-8d8f-45f4-b5f3-b9ba65e3068f</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;For the brocken CPU is there a hard way to erase all ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46467?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 12:15:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28568b1f-2892-4ef2-a009-56758ef9a572</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;I propose&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// disable all external interrupts
		NVIC-&amp;gt;ICER[0] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICER[1] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICER[2] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICER[3] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICER[4] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICER[5] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICER[6] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICER[7] = 0xFFFFFFFF;
		
		// clear all external pending interrupts
		NVIC-&amp;gt;ICPR[0] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICPR[1] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICPR[2] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICPR[3] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICPR[4] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICPR[5] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICPR[6] = 0xFFFFFFFF;
		NVIC-&amp;gt;ICPR[7] = 0xFFFFFFFF;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46466?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 12:15:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7a684b2-95a4-4452-b980-2014bf302d06</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;I did it and i have a CPU that i cannot recover with SWD...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46465?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 12:07:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2ce9491-ed9c-4ae9-a000-8d4cc8f3d920</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;True, SVC interrupt needs to be enabled before calling sd_softdevice_enable. __disable_irq seems more dangerous than i thought :). Just disable all peripheral interrupts instead&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46464?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 11:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c6d9990-1e2a-4737-9bba-beb6c7f94776</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;See that if you get some issues
&lt;a href="https://devzone.nordicsemi.com/question/70240/sd_softdevice_enable-hardfault/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46463?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 10:56:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d242b7e-9f66-400a-b466-c2ea1750a50f</guid><dc:creator>Fabien Comte</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug and old IRQ</title><link>https://devzone.nordicsemi.com/thread/46462?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2016 17:07:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a25c7a00-7159-4eb8-9821-196b7dfaa60c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   __disable_irq();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think this is ARM CMSIS funtion and it will disable all IRQ. This should be ok  as you are doing it before enabling softdevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>