<?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>How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7321/how-to-enable-and-disable-all-interrupts</link><description>Hi Team, 
 Is there any way to enable/disable all interrupts?
Will BLE connection get disconnected because of this? If yes the what are the possible ways to
maintain the connection?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Jun 2015 11:57:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7321/how-to-enable-and-disable-all-interrupts" /><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25935?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2015 11:57:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b010f9e2-4a74-4c5f-99e1-ff4d0702728b</guid><dc:creator>RK</dc:creator><description>&lt;ol&gt;
&lt;li&gt;no&lt;/li&gt;
&lt;li&gt;read the softdevice docs, it&amp;#39;s in there&lt;/li&gt;
&lt;li&gt;it&amp;#39;s &amp;#39;lose&amp;#39; not &amp;#39;loose&amp;#39;. If you&amp;#39;re using flow control then you won&amp;#39;t lose any bytes but you could get very backed up.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;using a separate UART chip is a much better idea here - I&amp;#39;ve looked before and there&amp;#39;s a few and they are quite cheap. I think it&amp;#39;s possible to make the timeslot api work but it would be very hard.&lt;/p&gt;
&lt;p&gt;Also Nordic is releasing its new NRF52 in a couple of weeks, I have no idea whether that will have more peripherals on it or be better able to deal with simultaneous operations. I&amp;#39;m hoping it will, but have zero information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25934?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2015 11:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b31310ac-9d7c-48a6-93d8-236cefc70867</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;My mobile application gets connected to nordic-slave-device, it sends some some command to nordic-slave-device.  After this there is no real data exchange and only low level handshaking packets are transferred between ble-master and ble-slave(i.e. nordic-slave-device).  Considering this following questions hangs my mind:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;After asking timeslot, is there any need to disable interrupts? If yes then how to do that?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;What is the maximum timeslot (in ms) we can ask for?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;What is the probability that we ask for a timeslot and we do not get it and ultimately loose some bytes over uart?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Or I just need to go for separate UART chip for better performance?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25930?ContentTypeID=1</link><pubDate>Fri, 29 May 2015 10:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de7a3969-4b09-4589-ac09-5e7eb8bd3f03</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;It&amp;#39;s described in the softdevice s110 specification- that has all the diagrams - about 3 pages. The API is under SoC functions here &lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a01316.html#ga988caf51c5727b9672737da6ee810b28"&gt;developer.nordicsemi.com/.../a01316.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25929?ContentTypeID=1</link><pubDate>Fri, 29 May 2015 10:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c1e3001-3e1f-4f4b-86ae-41c310543703</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;where is that document? I am not finding it here:
&lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00072.html"&gt;developer.nordicsemi.com/.../a00072.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25928?ContentTypeID=1</link><pubDate>Fri, 29 May 2015 10:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34f4941e-4105-4e85-a37a-c3e5d8976178</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I can&amp;#39;t really make that post any clearer. Go and read the multi protocol timeslot documentation, that tells you everything about how it works and how to use it. You just need to fit your bit banging into small chunks. If it&amp;#39;s not clear after reading it, then you&amp;#39;re probably not in a position to try writing the code.&lt;/p&gt;
&lt;p&gt;What, by the way, is wrong with the hardware UART built right into the chip? Why can&amp;#39;t you use that, it&amp;#39;s what it&amp;#39;s there for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25933?ContentTypeID=1</link><pubDate>Fri, 29 May 2015 08:23:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a1b63e6-da31-48bb-86f7-f0923cbf9e77</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;I am not getting clearly.
Can you tell me exact way to understand this? which are the APIs and how it works exactly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25932?ContentTypeID=1</link><pubDate>Fri, 29 May 2015 08:02:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f30de57-9645-47b0-858f-348e9ab06ff6</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Bottom line - you can&amp;#39;t do it. The max period you can disable interrupts is ZERO, you may not disable interrupts when the softdevice is running, not for 1ms, not for 1us, not at all, not ever. That is the contract you make with the softdevice. You cannot do time-sensitive operations with the softdevice running. Period.&lt;/p&gt;
&lt;p&gt;I wrote &lt;a href="http://tinyurl.com/ozteod4"&gt;this post&lt;/a&gt; a week or so outlining how someone could try to use the Multiprotocol Timeslot API which gives you occasional, irregular, small slots of time during which you can do what you like, to bitbang out 1 or 2 or 3 characters over a UART, then shut everything down and wait for the next time it gives you a slot and do the next few. That&amp;#39;s theoretically possible, it would be very hard to implement, you&amp;#39;d get very irregular transmission. My eventual suggestion was to use a separate UART chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25931?ContentTypeID=1</link><pubDate>Fri, 29 May 2015 04:54:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a844fa8-6c0c-4b75-918e-7c36ed341e54</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;I need to implement software uart i.e. uart bitbang and in which I need to require disable interrupts except the timer interrupt which is handling either TX or RX at a time.
Can you tell me how to this could be achieved?
What is the max time period for which i can disable required interrupts and then resume again so that it won&amp;#39;t hurt the ble connection?&lt;/p&gt;
&lt;p&gt;Say i need to send 8 bytes of data @9600 baud rate and I need to disable few other interrupts in &lt;strong&gt;ble_uart_app&lt;/strong&gt;  will ble remain in connection?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable and disable all interrupts ?</title><link>https://devzone.nordicsemi.com/thread/25927?ContentTypeID=1</link><pubDate>Fri, 29 May 2015 00:35:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6775bc6-afad-4172-87c3-f4a83ea48b31</guid><dc:creator>RK</dc:creator><description>&lt;ol&gt;
&lt;li&gt;Is there a way to enable/disable all interrupts. Yes, set primask. There&amp;#39;s a __disable_irq() and an __enable_irq() macro to do that .. however&lt;/li&gt;
&lt;li&gt;Will BLE connection get disconnected because of this? Yes, it will, perhaps not instantly, perhaps not every time. The longer you have them disabled, the more likely the SD will break  that time but even if you have them disabled for a really, really short time, it will eventually and randomly break. So don&amp;#39;t use the __disable_irq() or attempt to disable all interrupts. It will not work.&lt;/li&gt;
&lt;li&gt;What are the possible ways to maintain the connection? Don&amp;#39;t disable all interrupts is the way to maintain the connection. You can use the sd_nvic_critical_region_enter()/exit() functions to turn off all interrupts the softdevice isn&amp;#39;t using. That is the most you can do.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;What problem are you actually trying to solve?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>