<?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>Softdevice s112 RTC0 timer callback</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119711/softdevice-s112-rtc0-timer-callback</link><description>Hi, 
 SDK17, Softdevice S112, NRF52805 custom board. 
 I have baremetal bsp implemented but I am new to Softdevice and struggling a bit with an interface concept beween two. 
 My peripheral needs to send periodically battery level info, in addition to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Mar 2025 14:27:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119711/softdevice-s112-rtc0-timer-callback" /><item><title>RE: Softdevice s112 RTC0 timer callback</title><link>https://devzone.nordicsemi.com/thread/526781?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 14:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:836b16c8-62ac-4bb8-9661-f654f5c2df01</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. This number is the over all cunrrent consumption in that state, include regulators and LFCLK that are anyway active when you have the RTC0 running. Adding another RTC instance will add much less. The&amp;nbsp;100nA is from nRF52832 documentation, in practice I expect you will measure an even lower number if you compare a system with RTC0 only active and then add on RTC1.&lt;/p&gt;
&lt;p&gt;2. The SoftDevice will not ignore API calls without returning an error, so if you check the return code and handles relevant values explicitly instead of calling&amp;nbsp;APP_ERROR_HANDLER() for all, you can handle it specifically, and will not loose data.&lt;/p&gt;
&lt;p&gt;3. It is just a generic remark. The GATT Queue library does not rely on any hardware, so the only way it can increase current consumption is by execurition time (CPU cycles). If you add code that does work that is not needed, it is wasted energy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice s112 RTC0 timer callback</title><link>https://devzone.nordicsemi.com/thread/526776?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 14:15:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:262dc9dc-9edf-4ea7-a356-415c1b215145</guid><dc:creator>astomi</dc:creator><description>&lt;p&gt;HI,&lt;/p&gt;
&lt;p&gt;Thanks for this. Just to clarify couple of things.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;100nA is indeed insignificant, but where this number comes from? NRF52805 PS kind of suggests at least 300 nA (p.45 I&lt;span style="font-size:75%;"&gt;ON_RAMON_RTC_LFXO&lt;/span&gt; - I&lt;span style="font-size:75%;"&gt;ON_RAMON_EVENT&lt;/span&gt;)?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;I have looked at the Queue library but the description has left me confused = &amp;quot;&lt;span&gt;&lt;span style="color:#ff0000;"&gt;BLE GATT Queue module can be used to buffer BLE GATT requests if SoftDevice is not able to handle them at the moment&lt;/span&gt;&amp;quot;. In both example types, say BPS and Power Profiling no attempt is made to check whether &amp;quot;&amp;nbsp;&lt;span style="color:#993366;"&gt;SoftDevice is not able to handle&lt;/span&gt;&amp;quot; or deal with potential error (it just falls into APP_ERROR_HANDLER without retry). So question here is - if Softdevice even under ideal conditions can lose notification send requirest via hvx call, then queue is definitely required?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&amp;quot; &lt;span style="color:#339966;"&gt;&lt;a style="color:#339966;" href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_ble_gatt_queue.html"&gt;BLE GATT Queue library&lt;/a&gt;&amp;nbsp;... It does not add to the idle current consumption in any way, but if you use it without needing it it will add additional CPU cycles&lt;/span&gt;&amp;quot;&lt;br /&gt;Could you please elaborate on &amp;quot;use without needing&amp;quot; a bit please?&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice s112 RTC0 timer callback</title><link>https://devzone.nordicsemi.com/thread/526761?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 13:20:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e5a43c6-b451-4998-b879-28c0ff9d1d17</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I would not recomend the approach you are considering here. It will likely lead to higher current consumption and added complexity.&lt;/p&gt;
&lt;p&gt;1. You are right that the SoftDevice has no dependency on the app_timer, it uses RTC0 which is reserved for the SoftDevice. However, in practice virtuall all applications will need some form of low power timer, and app_timer represents that by making an arbitrary number of conceptual timers based on RTC1. The current consumption of an additional RTC instance is about&amp;nbsp;0.1 µA, which is negligible in most cases.&lt;/p&gt;
&lt;p&gt;2. The SoftDevice use the RTC for other purposes, and does not forward interrupts for itself to the application. So in order to use the RTC0 wakeup you would need to do somethign like routing the RTC0 compare event to an EGU, and generate an interrupt form that. Then run software to check the elapsed time and evaluate if you have work to do or not. And if you do, trigger the SAADC or similar. I suspect this will lead to a higher average current consumption and added complexity. (I must also say that I have never seen this approach used.)&lt;/p&gt;
&lt;p&gt;3. It is no problem making calls to&amp;nbsp;sd_ble_gatts_hvx() provided the prioirity is lower (higher number) than the SoftDevice, see &lt;a href="https://docs.nordicsemi.com/bundle/sds_s112/page/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html"&gt;Interrupt priority levels&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;4. The &lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_ble_gatt_queue.html"&gt;BLE GATT Queue library&lt;/a&gt;&amp;nbsp;was added to most examples, but it is not requiered. It does not add to the idle current consumption in any way, but if you use it without needing it it will add additional CPU cycles which results in at least a theoretical increase in average power consumption.&lt;/p&gt;
&lt;p&gt;PS: If you are starting development now, I woudl advice that you consider the nRF Connect SDK. See &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;nRF Connect SDK and nRF5 SDK statement&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>