<?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>nrf51822 gpiote could not enter interrupt routine</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28199/nrf51822-gpiote-could-not-enter-interrupt-routine</link><description>Hello I am using SDK12.3 without softdevice on a custom board (with nrf51822 256k flash, 16kram without 32768 crystal). 
 I have written some code using GPIOTE to detect two buttons (with app_button library) when pressed and it worked no problem on nrf5</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Dec 2017 13:53:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28199/nrf51822-gpiote-could-not-enter-interrupt-routine" /><item><title>RE: nrf51822 gpiote could not enter interrupt routine</title><link>https://devzone.nordicsemi.com/thread/111406?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 13:53:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7673feb0-15b9-4994-890d-6d52064bf023</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Are you able to run BLE applications? If you can do BLE you can be sure that you have handled the LF clock is working correctly. It shouldn&amp;#39;t be necessary to change anything other than the setting is the wizard.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 gpiote could not enter interrupt routine</title><link>https://devzone.nordicsemi.com/thread/111402?ContentTypeID=1</link><pubDate>Sat, 09 Dec 2017 05:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:963fa7ab-43bf-46b1-8448-c37f964fbb09</guid><dc:creator>Amigo</dc:creator><description>&lt;p&gt;Here is my code for nrf5 sdk 12&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void buttons_leds_init(bool * p_erase_bonds)
{
 bsp_event_t startup_event;
 uint32_t err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS,
                             APP_TIMER_TICKS(100, APP_TIMER_PRESCALER),
                             bsp_event_handler);
 APP_ERROR_CHECK(err_code);
 err_code = bsp_btn_ble_init(NULL, &amp;amp;startup_event);
 APP_ERROR_CHECK(err_code);
 *p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);

 #if defined  (NRF52832)
	// init LED
	nrf_gpio_cfg_output(LED2);
	// Set gas sensors manage output pins
	nrf_gpio_cfg_output(CO_Pin);
	nrf_gpio_cfg_output(CH4_Pin);

	nrf_gpio_pin_set(CO_Pin);
	nrf_gpio_pin_set(CH4_Pin);
	// init BUTTON		
	nrf_gpio_cfg_sense_input(BSP_BUTTON_0, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW);    
	nrf_gpio_cfg_sense_input(BSP_BUTTON_1, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW);
	nrf_gpio_cfg_sense_input(BSP_BUTTON_2, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW);  
	nrf_gpio_cfg_sense_input(BSP_BUTTON_3, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW); 

	NRF_GPIOTE-&amp;gt;INTENSET = GPIOTE_INTENSET_PORT_Msk;
            NVIC_EnableIRQ(GPIOTE_IRQn);
 #elif defined  (NRF51822)
	// init LED
	nrf_gpio_cfg_output( LED1 );
            nrf_gpio_cfg_sense_input(BSP_BUTTON_0, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW);    
	nrf_gpio_cfg_sense_input(BSP_BUTTON_1, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW);
	nrf_gpio_cfg_sense_input(BSP_BUTTON_2, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW);  
	nrf_gpio_cfg_sense_input(BSP_BUTTON_3, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW); 
            NRF_GPIOTE-&amp;gt;INTENSET = GPIOTE_INTENSET_PORT_Msk;
            NVIC_EnableIRQ(GPIOTE_IRQn);
 #endif	
}


void GPIOTE_IRQHandler(void)
{
  uint8_t bit;
  if(NRF_GPIOTE-&amp;gt;EVENTS_PORT)
  {
			if((~((NRF_GPIO-&amp;gt;IN) &amp;gt;&amp;gt; BSP_BUTTON_0) &amp;amp; 0x01)) val=0x00;
			if((~((NRF_GPIO-&amp;gt;IN) &amp;gt;&amp;gt; BSP_BUTTON_1) &amp;amp; 0x01)) __nop();
		#if defined  (NRF52832)
			if((~((NRF_GPIO-&amp;gt;IN) &amp;gt;&amp;gt; BSP_BUTTON_2) &amp;amp; 0x01)) __nop();
			if((~((NRF_GPIO-&amp;gt;IN) &amp;gt;&amp;gt; BSP_BUTTON_3) &amp;amp; 0x01)) __nop();
		#endif
    NRF_GPIOTE-&amp;gt;EVENTS_PORT = 0;
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 gpiote could not enter interrupt routine</title><link>https://devzone.nordicsemi.com/thread/111405?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 10:55:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26f460a6-0ec9-44dd-b03d-2c820d2d72e7</guid><dc:creator>mm81</dc:creator><description>&lt;p&gt;@ Martin&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Yes, except i have to change the pin definition correspondingly&lt;/li&gt;
&lt;li&gt;Yes.&lt;/li&gt;
&lt;li&gt;This is due to the hardware limitation.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Just a thought...is it possible due to the absent of 32768 crystal and somehow i do not configure to use internal RC properly?
I have set the CLOCK_CONFIG_LF_SRC to RC in Configuration Wizard.
Do i need to change any code in the project files??&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 gpiote could not enter interrupt routine</title><link>https://devzone.nordicsemi.com/thread/111404?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 09:55:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f484492-95bc-4a2f-a970-d666afe8b748</guid><dc:creator>MartinBL</dc:creator><description>&lt;ol&gt;
&lt;li&gt;So the exact same code works on the nRF51, but not your custom board?&lt;/li&gt;
&lt;li&gt;I assume you have double checked that you use the correct pins?&lt;/li&gt;
&lt;li&gt;Is there a reason why you configure Button 1 without pullup resistor, and button 2 with pullup?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 gpiote could not enter interrupt routine</title><link>https://devzone.nordicsemi.com/thread/111407?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 05:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56a9734d-e380-4fa7-b5ab-554fb3e028ff</guid><dc:creator>mm81</dc:creator><description>&lt;p&gt;Thanks Amigo, tried to add this but it makes no difference (also the original code works in NFF51 DK board do not need it)&lt;/p&gt;
&lt;p&gt;Below are the code i initialize the buttons...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void buttons_leds_init(bool * p_erase_bonds)
{    
	uint32_t err_code;
	static app_button_cfg_t p_button[] = {{BUTTON_1, APP_BUTTON_ACTIVE_HIGH, NRF_GPIO_PIN_NOPULL, button_handler},		
											  {BUTTON_2, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_handler}};	
				
	APP_GPIOTE_INIT(APP_GPIOTE_MAX_USERS);																					
	// Initializing the buttons.
	err_code = app_button_init(p_button, sizeof(p_button) / sizeof(p_button[0]), BUTTON_DEBOUNCE_DELAY);
	
	APP_ERROR_CHECK(err_code);																					
	err_code = app_button_enable();	
	APP_ERROR_CHECK(err_code); 
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 gpiote could not enter interrupt routine</title><link>https://devzone.nordicsemi.com/thread/111403?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 04:33:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:188b2546-d9aa-472c-bc1b-416071bb8737</guid><dc:creator>Amigo</dc:creator><description>&lt;p&gt;NVIC_EnableIRQ(GPIOTE_Irqn) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>