<?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>NRF_GPIOTE-&amp;gt;INTENSET = 1... Crashes with GPIOTE_CONFIG_POLARITY_LoToHi</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82675/nrf_gpiote--intenset-1-crashes-with-gpiote_config_polarity_lotohi</link><description>Hi Everyone, 
 I&amp;#39;m having problems getting GPIOTE_IRQHandler_v() to run. 
 &amp;quot;NRF_GPIOTE-&amp;gt;INTENSET = 1&amp;quot; causes my Nano 33 BLE to crash if &amp;quot;(GPIOTE_CONFIG_POLARITY_LoToHi &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos)&amp;quot; is enabled. 
 Otherwise it works as expected, i.e.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Dec 2021 15:54:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82675/nrf_gpiote--intenset-1-crashes-with-gpiote_config_polarity_lotohi" /><item><title>RE: NRF_GPIOTE-&gt;INTENSET = 1... Crashes with GPIOTE_CONFIG_POLARITY_LoToHi</title><link>https://devzone.nordicsemi.com/thread/343475?ContentTypeID=1</link><pubDate>Tue, 14 Dec 2021 15:54:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4953197a-7a97-48df-9609-bf8a658c672b</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;I&amp;#39;ve been thinking the same thing. It&amp;#39;s a shame. I&amp;#39;ll be working directly with your nRF5 SDK soon anyway, so that&amp;#39;ll be a good way for me to make a comparison. Thank you kindly for your help anyway, it&amp;#39;s much appreciated&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61c.svg" title="Stuck out tongue winking eye"&gt;&amp;#x1f61c;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_GPIOTE-&gt;INTENSET = 1... Crashes with GPIOTE_CONFIG_POLARITY_LoToHi</title><link>https://devzone.nordicsemi.com/thread/343344?ContentTypeID=1</link><pubDate>Tue, 14 Dec 2021 09:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e8cd159-503a-44e4-9edf-f8f63f570437</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I have a feeling that there is some conlict with other code of mbed, we typically don&amp;#39;t support mbed, but if you can provide a self contained project (zipped) in Keil that compiles I may be able to take alook.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_GPIOTE-&gt;INTENSET = 1... Crashes with GPIOTE_CONFIG_POLARITY_LoToHi</title><link>https://devzone.nordicsemi.com/thread/343265?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 17:22:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37b68870-de69-45bf-b20a-2ef3e13a856a</guid><dc:creator>GaryDT</dc:creator><description>&lt;p&gt;As a test program designed to have two different methods for acknowledging an input signal after it has been received from another board, that honestly was intentional, i.e., I was expecting to see a random occurrence of the two Serial.println()s executing within loop(). Just to point out that &amp;#39;action&amp;#39; is already being read/accessed as a global flag within loop(). Likewise, the EVENTS_IN[0] is being accessed in a global fashion within loop() too. I had already tested each method on its own.&lt;/p&gt;
&lt;p&gt;Anyway I&amp;#39;ve removed all the code down to a bare minimum to help better illustrate the problem. That is, the board is in a state of being crashed immediately after uploading the program, meaning that to recover it, the bootloader button needs pressing. Here&amp;#39;s the minimal program... (Also, the board is actually crashed without any input signal from my 2nd Nano)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;nrf.h&amp;gt;

#define PIN_GPIO (2) // ~D10 = P1.02 ... Nano 33 BLE
#define PORT (1)

void setup()
{			
	Serial.begin(115200);
	
	// Configure PIN_GPIO as input
	// ---------------------------		
	NRF_GPIO-&amp;gt;DIRSET = GPIO_DIRSET_PIN2_Input &amp;lt;&amp;lt; GPIO_DIRSET_PIN2_Pos; // Not actually required based on &amp;quot;Input&amp;quot; being the default
	
	// Configure GPIOTE
	// ----------------
	NRF_GPIOTE-&amp;gt;CONFIG[0] =
	
	(GPIOTE_CONFIG_MODE_Event   	&amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos) |
	(GPIOTE_CONFIG_POLARITY_LoToHi	&amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos) | // (Commenting this line stops the board crashing. But: GPIOTE_IRQHandler_v() still doesn&amp;#39;t run) 
	(PORT                			&amp;lt;&amp;lt; GPIOTE_CONFIG_PORT_Pos) |     // (Although it&amp;#39;s actually pointless commenting the above line because then no IN[n] events will be generated)
	(PIN_GPIO                       &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos);		
	
	// NRF_GPIOTE-&amp;gt;INTENSET = GPIOTE_INTENSET_IN0_Set &amp;lt;&amp;lt; GPIOTE_INTENSET_IN0_Pos (same as INTENSET = 1)
	NRF_GPIOTE-&amp;gt;INTENSET = 1; // Set = 1 &amp;amp; [0] = Bit number 0 (Commenting this line stops the board crashing, which causes &amp;quot;EVENTS_IN: Has Fired ++++&amp;quot; to successfully be displayed periodically)		
	NVIC_EnableIRQ(GPIOTE_IRQn); 
}

extern &amp;quot;C&amp;quot; void GPIOTE_IRQHandler_v()
{			
	
}

void loop()
{		

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF_GPIOTE-&gt;INTENSET = 1... Crashes with GPIOTE_CONFIG_POLARITY_LoToHi</title><link>https://devzone.nordicsemi.com/thread/343188?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 13:32:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20dd2e25-2991-4850-b599-0e8d54eb8a6a</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Isn&amp;#39;t it a bit scary that both&amp;nbsp;your interrupt&amp;nbsp;handler and main are checking and clearing the NRF_GPIOTE-&amp;gt;EVENTS_IN[0] event? I suggest that the interrupt handler will take of the interrupt, while it can use a global flag (in your case &amp;#39;action&amp;#39;) to inform main() that it was set. In other words comment out the handling of&amp;nbsp;&lt;span&gt;NRF_GPIOTE-&amp;gt;EVENTS_IN[0] in the main() loop when checking the action flag. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also suggest that you disable the GPIOTE event interrupt when setting the action flag, and then in the main loop you can enable it again after handling the action flag. Else the&amp;nbsp;GPIOTE_IRQHandler_v() may be continsouly triggering, preventing/delaying other processes from running, depending on the interrupt priority of&amp;nbsp;GPIOTE_IRQHandler_v().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>