<?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>Problem in starting advertisement in gpiote interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9686/problem-in-starting-advertisement-in-gpiote-interrupt</link><description>Hi, 
I&amp;#39;m trying to start advertising in gpiote interrupt. I have modified ble_hrs_demo code. I&amp;#39;m suing nrf51-dk with SDK9 and S110. Here are my code snippets(they are not in order here): 
 static void gpiote_init()
{
ret_code_t err_code;

err_code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Oct 2015 19:02:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9686/problem-in-starting-advertisement-in-gpiote-interrupt" /><item><title>RE: Problem in starting advertisement in gpiote interrupt</title><link>https://devzone.nordicsemi.com/thread/35820?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2015 19:02:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50ea2f5f-ee20-4bde-8535-da78f3b52dea</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I do not have the code available to verify, but i think&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This above code If I remember correctly passing true means hi_accuracy, which willrequest the GPIOTE interrupt handler to be in higher priority (priority APP_PRIORITY_HIGH = 1). So your gpiote callback will be called with priority 1 (APP_PRIORITY_HIGH), and it is not allowed to make SVC (sd_xxx) calls in this context, otherwise it will trigger the hardfault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem in starting advertisement in gpiote interrupt</title><link>https://devzone.nordicsemi.com/thread/35819?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2015 15:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33ea0644-dc83-44fd-bd9c-103d8718dda6</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;It looks like the problem is with gpiote interrupt. If I try to call any external function, the program either restarts or goes into hardfault handler. I&amp;#39;ve tried disabling gpiote, starting timer, stopping timer. All the codes resulted in the reset of device. Whereas if i change a flag in interrupt handler and read the flag in main loop, and do the changes there, the code works fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>