<?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>things allow/not allowed to call from callbacks NRF52/S132</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18077/things-allow-not-allowed-to-call-from-callbacks-nrf52-s132</link><description>Hi! 
 I was developing my custom service, and had a question around what kind of functionality is allowed or not allowed within a callback from the soft device or other peripheral drivers. 
 Examples: 
 example #1: softdevice handler for BLE events</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Dec 2016 11:14:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18077/things-allow-not-allowed-to-call-from-callbacks-nrf52-s132" /><item><title>RE: things allow/not allowed to call from callbacks NRF52/S132</title><link>https://devzone.nordicsemi.com/thread/69717?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2016 11:14:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e477eb91-98ec-4642-9c96-e25e86f2bdab</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure why you can&amp;#39;t print floats, maybe add a separate question? I&amp;#39;m not sure what kind of overview you are after, but &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/processor_avail_interrupt_latency/processor_avail_interrupt_latency.html?cp=2_3_0_0_15"&gt;this&lt;/a&gt; Section in the SoftDevice specification should be examined at least.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: things allow/not allowed to call from callbacks NRF52/S132</title><link>https://devzone.nordicsemi.com/thread/69721?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 13:48:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b80efdf1-d1ef-438a-90be-8f8181ca2c96</guid><dc:creator>peter</dc:creator><description>&lt;p&gt;Hi Petter, your comments so far helped a lot. summarizing again:&lt;/p&gt;
&lt;p&gt;issue #1 is still the same&lt;/p&gt;
&lt;p&gt;issue #2 for TWI I changed the priority to LOW (just took the HIGH prio over from the TWI example in the SDK without looking at it too closely) -&amp;gt; this seems to work a lot better&lt;/p&gt;
&lt;p&gt;issue #3: ok, I found it and understood it, so no issue anymore.&lt;/p&gt;
&lt;p&gt;issue #4: now that the TWI callback works correctly, if I do NRF_LOG_INFO(&amp;quot;%f&amp;quot;,some_float_var), it will hang right there, unless I add linker option -u _printf_float, then it will always print 0.000000. I saw the macros for outputting a float as two integers, is this the recommended option?&lt;/p&gt;
&lt;p&gt;as for the overview, it wasn&amp;#39;t completely clear to me from the docs on how those IRQ levels behave and what exactly is possible. I know that the docs mentioned several things, but it wasn&amp;#39;t completely clear. I think I understand the IRQ levels now and my mistake with TWI there, but as for issue #1 and #4, it&amp;#39;s unclear to me how IRQ levels that I control would influence that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: things allow/not allowed to call from callbacks NRF52/S132</title><link>https://devzone.nordicsemi.com/thread/69720?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 13:00:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71a47aab-25f8-4f42-85a9-6e98dca82fbf</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure what kind of overview you mean, but you cannot call SoftDevice API from APP_IRQ_PRIORITY_HIGH (1). This is because every SoftDevice API call is triggering SVC interrupt and this interrupt is on level 2 (lower than application high level).&lt;/p&gt;
&lt;p&gt;You can call SoftDevice (including sd_nvic_... functions) from APP_IRQ_PRIORITY_LOW (3) and main context.&lt;/p&gt;
&lt;p&gt;The behavior you describe sounds really strange. What do you mean by one advertisment? One advertising packet? Then it would be very difficult for a central to connect...?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: things allow/not allowed to call from callbacks NRF52/S132</title><link>https://devzone.nordicsemi.com/thread/69719?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 12:50:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:799119a0-eca7-4c55-a0f4-33f309840cc9</guid><dc:creator>peter</dc:creator><description>&lt;p&gt;Hi! that was APP_IRQ_PRIORITY_HIGH, is there a good overview what kind of things need which priorty?&lt;/p&gt;
&lt;p&gt;Also something that might be related: if I turn on logging (compile flag NRF_LOG_ENABLED=1), then there will be exactly one advertisement, and nothing else. Also e.g. the app_timer does not work while advertising, but as soon as somebody connects, it will start working. Any ideas what all if this could be?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: things allow/not allowed to call from callbacks NRF52/S132</title><link>https://devzone.nordicsemi.com/thread/69718?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 11:46:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:216ad6df-77d6-4424-bb84-f397e5a2616e</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;For 2, what interrupt priority have you configured the driver to use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>