<?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>BLE RADIO ON/OFF in interrupt handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13148/ble-radio-on-off-in-interrupt-handler</link><description>Hi,
Am using NRF52 S132 softdevice,
I have a use case like when I press a button , I should turn off BLE. So I enabled an interrupt for button. Whenever this button is pressed in the interrupt handler I called
sd_ble_gap_adv_stop(); but it hanged </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Apr 2016 06:11:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13148/ble-radio-on-off-in-interrupt-handler" /><item><title>RE: BLE RADIO ON/OFF in interrupt handler</title><link>https://devzone.nordicsemi.com/thread/50125?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 06:11:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89087087-e3c3-46ba-b3eb-540460b58e0b</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;Hi RK Sorry, I have both NRF51 and NRF52 with me, with NRF52 it was working when I set the priority to lowest priority but not with NRF51 . How can I get it working in NRF51&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE RADIO ON/OFF in interrupt handler</title><link>https://devzone.nordicsemi.com/thread/50124?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 06:07:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2613e63d-1223-43c8-a791-87fb35171719</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Nothing much right there. Firstly priority 3 isn&amp;#39;t APP_IRQ_PRIORITY_LOW, that&amp;#39;s the nRF51, low on the nRF52 is 6 and lowest is 7. Secondly the only priorities available to the app are 2, 3, 6 and 7 so you can&amp;#39;t use 4 and finally the SVC priority is 4, defined by the softdevice itself. So you&amp;#39;ve actually just set the priority to the same as the SVC call one and you are still hardfaulting. Change it to a proper low value like 6.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE RADIO ON/OFF in interrupt handler</title><link>https://devzone.nordicsemi.com/thread/50123?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 05:56:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2be22d7f-10a4-440f-a20e-7668eb61c77e</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;My SVC call priority is 3 (APP_IRQ_PRIORITY_LOW)&lt;/p&gt;
&lt;p&gt;void gpio_interrupt_init(void)
{
/&lt;em&gt;-------------------------- INTERRUPT MODE ------------------------------------------&lt;/em&gt;/
NRF_GPIOTE-&amp;gt;CONFIG[1] =  (GPIOTE_CONFIG_POLARITY_HiToLo &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos)
| (BUTTON_1 &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos)
| (GPIOTE_CONFIG_MODE_Event &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos);
NRF_GPIOTE-&amp;gt;INTENCLR = GPIOTE_IRQ_INTENCLR_ALL_VAL;
NRF_GPIOTE-&amp;gt;INTENSET =  (GPIOTE_INTENSET_IN1_Set &amp;lt;&amp;lt; GPIOTE_INTENSET_IN1_Pos);
NVIC_SetPriority(GPIOTE_IRQn, 4);	
NVIC_EnableIRQ(GPIOTE_IRQn);
}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE RADIO ON/OFF in interrupt handler</title><link>https://devzone.nordicsemi.com/thread/50122?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 05:45:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be3c1c55-e6f1-4323-903f-2a9faf5c6abb</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;post the code where you change the GPIO interrupt priority&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE RADIO ON/OFF in interrupt handler</title><link>https://devzone.nordicsemi.com/thread/50121?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 05:01:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45444013-157e-41a8-89a5-d7ec8eb62fec</guid><dc:creator>Thangaraj</dc:creator><description>&lt;p&gt;Hi RK Thanks for your reply and sorry for the delay in my response.. Yes as you said My GPIO interrupt and the ble satck interrupt are of same priority, but when I try to change the priority as per your suggestion my code is keep on rebooting .. What I want to do is this -&amp;gt; In my ble_app_uart eaxample I need to send data to the another device via BLE whenever a button is pressed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE RADIO ON/OFF in interrupt handler</title><link>https://devzone.nordicsemi.com/thread/50120?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 13:32:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1373a1a-f79b-4060-b3ce-e00de90034c1</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;What&amp;#39;s the priority of the button interrupt? If it&amp;#39;s high then it&amp;#39;s higher than the SVC call priority and the ARM Cortex will hardfault. It needs to be low if you want to call sd_* functions from it.&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s that - this is discussed at least 5 times a week, a quick search would have answered the question; if it&amp;#39;s not, then it didn&amp;#39;t &amp;quot;hanged&amp;quot;, there&amp;#39;s an error or a hardfault, hit the break button and find out where you are and update the question with more information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>