<?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>GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13644/gpio-interrupt-not-triggered</link><description>I am trying to set up a button interrupt by adding the following functions: 
 void button_interrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
 nrf_gpio_pin_toggle(LED_4);
}

void button4_config()
{
 nrf_drv_gpiote_in_config_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jun 2016 07:51:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13644/gpio-interrupt-not-triggered" /><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52136?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2016 07:51:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b80c9230-5c0d-4f2b-a19c-98d8184801fa</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;@Kristin: Ah, that is exactly what I have been doing. Thanks for the help, Kristin and Petter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52135?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2016 16:42:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d60a5244-f640-466a-ba9f-1f620c11bca3</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The easiest way is to just change the number of buttons and LEDs defined in pca10028.h.&lt;/p&gt;
&lt;p&gt;If you want to keep pca10028.h unmodified, you can do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Copy pca10028.h and create a new pca10028 board file: my_board.h&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Change the number of buttons/LEDs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the top of my_board.h, change the define to f.ex:&lt;/p&gt;
&lt;p&gt;#ifndef MY_BOARD_H
#define MY_BOARD_H&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add my_board.h to the list of boards in boards.h (named f.ex: BOARD_MY_BOARD)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In project -&amp;gt;options for target -&amp;gt; C/C++ -&amp;gt; &amp;quot;define&amp;quot;: replace BOARD_PCA10028 with BOARD_MY_BOARD&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52134?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2016 04:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15cb1ab0-f4a6-4b25-a860-01a3b84294e6</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;@kristin: I understood that I could simply remove BSP. However, what I am asking is for quick test, is there a way for me to override just 1-2 buttons and 1-2 LED that the BSP controls, without having to configure BSP again.&lt;/p&gt;
&lt;p&gt;I figured one of the thing I could do is create a template project where it includes a modified pca10028.h that only make use of 2 LED and 2 Button. Yet if there is a better way I am interested in learning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52133?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 11:13:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d5ff1ff-f2cf-478b-b662-25c4f2f16299</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The example provided in &lt;a href="https://devzone.nordicsemi.com/question/76783/gpiote-interrupt-not-triggered/?answer=77221#post-id-77221"&gt;this&lt;/a&gt; thread replaces the BSP module by GPIOTE events directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52132?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 11:12:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f6d4cf0-7d54-4267-bbe9-35ee213b2fd1</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Yes, you can choose to not include the BSP module in your project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52131?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 04:10:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70829d5f-ab18-4e7f-98bd-71eae4be6239</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;My sincere apology, Petter. I was tangled up with a lot of deadline soon after our last discussion, and replying to you slipped out of my mind.&lt;/p&gt;
&lt;p&gt;What I meant by overwriting the button behavior is replacing the behavior &lt;code&gt;bsp_init()&lt;/code&gt; programmed with my own.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52127?ContentTypeID=1</link><pubDate>Thu, 19 May 2016 14:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c48662f-b604-4593-94a6-ed5362f2f0ac</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Yes. It should be pulled up. Overwrite the button behavior? I don&amp;#39;t quite understand.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52130?ContentTypeID=1</link><pubDate>Thu, 19 May 2016 09:20:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9650205a-d9c7-4f43-9cbf-c8c1f1db9fa4</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;*update: fixed that extreme sensitivity issue. Turns out I should have the GPIO pin being pulled up, so I did just that.&lt;/p&gt;
&lt;p&gt;So my new question would be, is it impossible to overwrite the button behavior set by &lt;code&gt;bsp_init()&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52129?ContentTypeID=1</link><pubDate>Thu, 19 May 2016 09:18:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbffb50d-6cfd-4231-acbd-d4f404e13fcf</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Also, my application is based off of the ble_app_uart example so during setup it also call:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code = bsp_init(BSP_INIT_LED /* | BSP_INIT_BUTTONS */,
                                 APP_TIMER_TICKS(100, APP_TIMER_PRESCALER), 
                                 bsp_event_handler);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Perhaps this matters?
I tried remove &lt;code&gt;| BSP_INIT_BUTTON&lt;/code&gt; from the parameter and managed to make the button works somehow. However, it seems the button is extremely sensitive, just my hand touching it causes LED 4 to blink rapidly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52128?ContentTypeID=1</link><pubDate>Thu, 19 May 2016 09:10:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ac54fab-f937-43be-91a0-3e86cf0f92ca</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Petter,&lt;/p&gt;
&lt;p&gt;Sorry for being late with the follow up. I just got out of a very tight deadline rush.&lt;/p&gt;
&lt;p&gt;I have tried explicitly calling the function &lt;code&gt;nrf_drv_gpiote_init()&lt;/code&gt; as you shown in your code. However that does not help. It returns &lt;code&gt;NRF_ERROR_INVALID_STATE&lt;/code&gt; indicating that GPIOTE has already been initialized by something else.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52126?ContentTypeID=1</link><pubDate>Thu, 05 May 2016 02:26:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b804354-af48-4555-8b72-0f440e3955d3</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Petter, I indeed missed that function call. However it is coincidentally covered when I called &lt;code&gt;app_pwm_init()&lt;/code&gt; at an earlier point in my application, so it does not seem to be the problem.&lt;/p&gt;
&lt;p&gt;I have however added the call into my &lt;code&gt;button4_config()&lt;/code&gt; as instructed in the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Fhardware_driver_gpiote.html&amp;amp;resultof=%22nrf_drv_gpiote_init%28%29%22%20"&gt;GPIOTE driver page&lt;/a&gt;, however the button interrupt is still not called.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO Interrupt not triggered</title><link>https://devzone.nordicsemi.com/thread/52125?ContentTypeID=1</link><pubDate>Wed, 04 May 2016 11:48:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16cdc382-c591-4069-a66c-1b56ff637688</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I can&amp;#39;t see that you are calling nrf_drv_gpiote_init() anywhere&lt;/p&gt;
&lt;p&gt;Edit 1: Try this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void button_interrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
    nrf_gpio_pin_toggle(LED_4);
}

static void button4_config()
{
    nrf_drv_gpiote_in_config_t config;
    memset(&amp;amp;config, 0, sizeof(nrf_drv_gpiote_in_config_t));
    config.sense = NRF_GPIOTE_POLARITY_HITOLO;
    config.pull = NRF_GPIO_PIN_PULLUP;
    config.hi_accuracy = false;
    config.is_watcher = false;

    nrf_drv_gpiote_in_init(BUTTON_4, &amp;amp;config, button_interrupt_handler);
    nrf_drv_gpiote_in_event_enable(BUTTON_4, true);

}

/**
 * @brief Function for application main entry.
 */
int main(void)
{
    ret_code_t err_code;

    nrf_gpio_cfg_output(LED_4);
        
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);

    button4_config();

    while (true)
    {
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>