<?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>Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13636/button-1-2-resets-nrf51-dk</link><description>I am trying to set up a GPIO interrupt, and found that whenever Button 1 is pressed, if Button 1 or 2 is pressed later, the app will reset. This is even if there is any other buttons are pressed in between the two button presses. For example: 
 
 Pressing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 May 2016 08:00:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13636/button-1-2-resets-nrf51-dk" /><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52084?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 08:00:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6141730d-efa4-4b57-897a-b79f1e67e35a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Thanks to the tips from &lt;a href="https://devzone.nordicsemi.com/users/1377/rols/"&gt;@RK&lt;/a&gt;, I found that this is a behavior of the BSP Button Module, which is documented here:
&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Fexamples_bsp_btn_ble.html&amp;amp;cp=4_0_1_3_4_1"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52083?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 07:59:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ced5570c-c28b-4824-bacc-cc41ebb9fddb</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Couldn&amp;#39;t find it mentioned in the UART Example page, but I finally found the behavior documented here: &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Fexamples_bsp_btn_ble.html&amp;amp;cp=4_0_1_3_4_1"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As always, thanks RK for pointing me in the right directions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52082?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 04:17:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56038a0e-7522-499a-bd53-bcf18ec1efba</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;I think that is what is going on. After I pressed Button 1, the advertising LED stop blinking. So I am guessing this behavior is configured in &lt;em&gt;bsp_btn_ble.c&lt;/em&gt; or &lt;em&gt;app_button.c&lt;/em&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52081?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 04:11:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29f0bbcd-edee-42ae-bd6f-fe999dd07405</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;What does the documentation for that particular example say the buttons are supposed to do? Perhaps button 1 is default configured to put the chip into sleep mode, at which point you&amp;#39;d expect to see an LED light up and another button press of whatever button is default configured to wake it up, to wake it up again.&lt;/p&gt;
&lt;p&gt;All the examples are documented - go see what it says about the particular one you&amp;#39;re using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52080?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 04:05:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccb7f30c-3fd5-4a9d-8aae-0dd19ee2887d</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;@rols: Are you sure this is a bug? I just tested with a fresh &lt;em&gt;ble_app_uart&lt;/em&gt; example, with the only modification being UART config (baud 9600, no HWFC). The same behavior remains.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52079?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 03:46:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c866067-6a39-4088-94d0-a919bf513ecd</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;The softdevice could reset the chip, the hardfault handler could reset it and none of those would show up in a project wide system search for nvic_systemreset. There&amp;#39;s only 3 options here, either a soft reset is being requested by something writing the register, error handler, hardfault handler, softdevice etc ..,  the reset pin is being pulled low or  it&amp;#39;s resetting because power was removed and replaced due to an electrical issue.&lt;/p&gt;
&lt;p&gt;Wy don&amp;#39;t you clear the RESETREAS (by writing 0xffffffff) to it, then breakpoint in main() and find out after you get reset what the reason was.&lt;/p&gt;
&lt;p&gt;Or put a data breakpoint to find out when the register is written to (I think that ought to work).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52078?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 03:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1022d721-7825-469c-a7a1-1b96dc80ff1c</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;I checked &lt;code&gt;APP_ERROR_CHECK()&lt;/code&gt; macro. It runs the &lt;code&gt;APP_ERROR_HANDLER()&lt;/code&gt; macro which in turns runs a call of &lt;code&gt;app_error_handler()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Also a project wide search of &lt;em&gt;nvic_systemreset&lt;/em&gt; shows that the only call in the entire project is in &lt;code&gt;app_error_handler()&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52077?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 03:18:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28d86ad7-1937-4306-ad1c-a8f80023463f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;if the break point is greyed out then that probably indicates that&amp;#39;s not the error handler compiled into your application. If that&amp;#39;s not the one compiled in, defining DEBUG won&amp;#39;t help. So that&amp;#39;s the first thing to figure out, what app error handler is called from the app error check macro. Find it, put a breakpoint in it and force an app error check until you can hit your own debug point.&lt;/p&gt;
&lt;p&gt;There are few other things which would cause a chip reset. A bad error would go to the hardfault handler (but you should go see what that one does too, perhaps that also resets the chip), pulling the reset line low would do it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52076?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 03:13:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:919a305c-f2ba-456d-9880-356cf10d51b9</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Also to add, the above tests are all done with all of my GPIOTE related code removed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52075?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 03:11:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b5391b3-8b50-45b9-9374-6fc954dedaea</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;@rols: I have set a break point in &lt;code&gt;app_error_handler()&lt;/code&gt; in app_error.c. However, when the system reset, the break point is never reached. As a matter of fact, that break point is greyed out when I enter debug mode.&lt;/p&gt;
&lt;p&gt;Another thing I tried to do is add the preprocessor &lt;code&gt;DEBUG&lt;/code&gt;. This supposedly change the &lt;code&gt;app_error_handler()&lt;/code&gt; behavior to trapping the application in an infinite loop. However, when I pressed the button as described, the app still reset.
Do you have any other guesses what might be happening?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button 1-2 resets nRF51-DK</title><link>https://devzone.nordicsemi.com/thread/52074?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 02:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b5e63ae-e0a4-4bb9-81f1-7f3cb5a0f7f5</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;no it&amp;#39;s not a back door - you have a bug - I&amp;#39;d start in the app error handler because that&amp;#39;s 99.99% of the time where errors are caught and the default behaviour is to reset the chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>