<?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 Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot</link><description>I&amp;#39;m trying to narrow down the cause of a Softdevice assertion happening in S132 7.2.0 at PC=0x15810. 
 We set up a proprietary RF project which utilises parts of the SDK for Mesh (specifically, the timeslot implementation and bearer_handler) because it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Mar 2021 13:37:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot" /><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/299012?ContentTypeID=1</link><pubDate>Wed, 10 Mar 2021 13:37:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35a72f21-e786-4a32-92a2-4bdaf63b2ba1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
[quote user="m.wagner"]Does that have any implications on product certification?[/quote]
&lt;p&gt;No, the choice of clock source have no impact on qualification or certifications. So the question is basically if this works well in your product or not.&lt;/p&gt;
[quote user="m.wagner"]&lt;p&gt;It would surprise me if there were any significant temperature variations. There is a motor with all the necessary periphery on the board as well, but my testing was done without any motor activity whatsoever.&lt;/p&gt;
&lt;p&gt;Also - I think I mentioned it earlier - while I was still running the RC oscillator with its default configuration, I did not observe any recalibration due to temperature drift. I.e. I traced NRF_CLOCK-&amp;gt;EVENTS_DONE via PPI and did never observe recalibration occurring after 4s instead of 8s.&lt;/p&gt;[/quote]
&lt;p&gt;I see, thanks for confirming. I just wanted to rule out any temperature change effects. (You are of course also right that this should have triggered more calibrations in that case.)&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/298782?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 15:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4ef419d-7680-40a2-84a3-ab2d47fb0f6d</guid><dc:creator>m.wagner</dc:creator><description>[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/298725#298725"]The downside is that the SoftDevice is not tested with SYNT clock source, which is why we state that it is not supported.[/quote]
&lt;p&gt;Does that have any implications on product certification?&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/298725#298725"]I would expect you should see a further improvement by using RC_CTIV 1 to calibrate even more often (and still TEMP_CTIV 0)?[/quote]
&lt;p&gt;I assume so, but I&amp;#39;ll have to test this in long-term tests. I deliberately tested with &lt;span style="font-family:courier new, courier;"&gt;NRF_SDH_CLOCK_LF_RC_CTIV 8&lt;/span&gt;, to see if the issue still persists and intend to further reduce the value and see how it behaves.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/298725#298725"]Without knowing your HW I would not think this could be the main issue. If the HFXO is significantly off you would not get BLE working (frequencies would be shifted).[/quote]
&lt;p&gt;That confirms what I discussed with our HW engineer.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/298725#298725"] if your product is a type of product that could see significant rapid temperature changes (like a lightbulb when it is being turned on or off). Do you see this issue mostly around times when temperature changes, or also when the temperature is roughly stable?[/quote]
&lt;p&gt;It would surprise me if there were any significant temperature variations. There is a motor with all the necessary periphery on the board as well, but my testing was done without any motor activity whatsoever.&lt;/p&gt;
&lt;p&gt;Also - I think I mentioned it earlier - while I was still running the RC oscillator with its default configuration, I did not observe any recalibration due to temperature drift. I.e. I traced NRF_CLOCK-&amp;gt;EVENTS_DONE via PPI and did never observe recalibration occurring after 4s instead of 8s.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/298725?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 13:38:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fde0beda-7a10-4600-9f8d-4b0a9873a5ec</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
[quote user="m.wagner"]&lt;p&gt;Are there any downsides to using this apart from current consumption? For our setup with power supply and maximised radio uptime (i.e. HFCLK is always running), it seems like this is actually the &amp;quot;better&amp;quot; solution for this issue than using the RC oscillator.&lt;/p&gt;
&lt;p&gt;Considering the symptoms of the issue, I think this should resolve it from a software POV.&lt;/p&gt;[/quote]
&lt;p&gt;The downside is that the SoftDevice is not tested with SYNT clock source, which is why we state that it is not supported. That said my understanding is that there is no reason to believe that there should be any issues with SYNT other than current consumption, so it could be a good choice as long as you accept the risk with it not being properly tested.&lt;/p&gt;
[quote user="m.wagner"]&lt;p&gt;In the meantime, unfortunately it looked like the unwanted drift still occurs even with &lt;span style="font-family:courier new, courier;"&gt;#define NRF_SDH_CLOCK_LF_RC_CTIV 8&lt;/span&gt; and &lt;span style="font-family:courier new, courier;"&gt;NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The frequency of it happening is massively reduced, though. While it seemed to happen once in 10 - 15mins with &lt;span style="font-family:courier new, courier;"&gt;NRF_SDH_CLOCK_LF_RC_CTIV 16 &lt;/span&gt;and &lt;span style="font-family:courier new, courier;"&gt;NRF_SDH_&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;CLOCK_LF_RC_TEMP_CTIV 2, &lt;/span&gt;it only happened about twice or thrice a day with the above configuration.&lt;/p&gt;[/quote]
&lt;p&gt;I would expect you should see a further improvement by using RC_CTIV 1 to calibrate even more often (and still TEMP_CTIV 0)?&lt;/p&gt;
[quote user="m.wagner"]I also looked into &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_192.html?cp=4_2_1_0_1_49"&gt;Erratum 192&lt;/a&gt;, which looked like it may be interfering here, but the fact that it happens less frequently with more frequent calibration seems to contradict this...[/quote]
&lt;p&gt;The workaround for erratum 192 is uses in the SoftDevice you use (7.2.0), so it should not be relevant in this case.&lt;/p&gt;
[quote user="m.wagner"]&lt;p&gt;I do have one suspicion as to the cause of the issue: Is it possible that the cause could be a mismatch of the HFXO load capacitance? It does not look right to me, but I&amp;#39;ll have to talk to our HW engineer. We do not seem to have any issues with BLE, though.&lt;/p&gt;
&lt;p&gt;EDIT2:&lt;/p&gt;
&lt;p&gt;It does indeed seem that C_pin_HFXO and C_PCB have been neglected when calculating the required capacitance. The XTAL requires a C_L of 6pF while we currently do have a C_L in the range of 8pF to 9pF (assuming C_PCB between 0pF and 2pF).&lt;/p&gt;[/quote]
&lt;p&gt;Without knowing your HW I would not think this could be the main issue. If the HFXO is significantly off you would not get BLE working (frequencies would be shifted). It is good to look into though.&lt;/p&gt;
&lt;p&gt;I have one other question. As you do not care about current consumption I was wondering if your product is a type of product that could see significant rapid temperature changes (like a lightbulb when it is being turned on or off). Do you see this issue mostly around times when temperature changes, or also when the temperature is roughly stable?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/298600?ContentTypeID=1</link><pubDate>Tue, 09 Mar 2021 09:23:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ceffc8fd-b8ea-47c1-8a4f-dbf12064beb7</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Sorry for the late response - I&amp;#39;ve been out of the office for a few days.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/297465#297465"]It seems clear that this is clock related, but not exactly how. Did you by any chance test with&amp;nbsp;NRF_CLOCK_LF_SRC_SYNTH?[/quote]
&lt;p&gt;I did not yet test with NRF_CLOCK_LF_SRC_SYNTH, but will do such a test now.&lt;/p&gt;
&lt;p&gt;Are there any downsides to using this apart from current consumption? For our setup with power supply and maximised radio uptime (i.e. HFCLK is always running), it seems like this is actually the &amp;quot;better&amp;quot; solution for this issue than using the RC oscillator.&lt;/p&gt;
&lt;p&gt;Considering the symptoms of the issue, I think this should resolve it from a software POV.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Status Quo&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the meantime, unfortunately it looked like the unwanted drift still occurs even with &lt;span style="font-family:courier new, courier;"&gt;#define NRF_SDH_CLOCK_LF_RC_CTIV 8&lt;/span&gt; and &lt;span style="font-family:courier new, courier;"&gt;NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The frequency of it happening is massively reduced, though. While it seemed to happen once in 10 - 15mins with &lt;span style="font-family:courier new, courier;"&gt;NRF_SDH_CLOCK_LF_RC_CTIV 16 &lt;/span&gt;and &lt;span style="font-family:courier new, courier;"&gt;NRF_SDH_&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;CLOCK_LF_RC_TEMP_CTIV 2, &lt;/span&gt;it only happened about twice or thrice a day with the above configuration.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/297465#297465"]Perhaps it is somehow related to &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_146.html"&gt;erratum 146&lt;/a&gt;&amp;nbsp;though I do not immediately see how.[/quote]
&lt;p&gt;The application should account for 500ppm RC clock drift, so I&amp;#39;m not sure this applies. Though could this drift be even larger?&lt;/p&gt;
&lt;p&gt;I also looked into &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_192.html?cp=4_2_1_0_1_49"&gt;Erratum 192&lt;/a&gt;, which looked like it may be interfering here, but the fact that it happens less frequently with more frequent calibration seems to contradict this...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/297465#297465"]Another thing... When initializing the mesh stack with&amp;nbsp;mesh_stack_init(), you pass a&amp;nbsp;mesh_stack_init_params_t instance which has a member core.lfclksrc. Is this correctly configured, with the correct accuracy?[/quote]
&lt;p&gt;FYI: Since I delivered the Mesh-example I reverted back to working on our actual non-mesh application. We only use parts of the Mesh-stack, specifically the timeslot- and bearer_handler-modules and whatever is needed to support these.&lt;/p&gt;
&lt;p&gt;I did verify multiple times that the accuracy-parameter passed into timeslot_init() is correct (500ppm), so the drift calculation should work with the intended results.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT:&lt;/p&gt;
&lt;p&gt;I do have one suspicion as to the cause of the issue: Is it possible that the cause could be a mismatch of the HFXO load capacitance? It does not look right to me, but I&amp;#39;ll have to talk to our HW engineer. We do not seem to have any issues with BLE, though.&lt;/p&gt;
&lt;p&gt;EDIT2:&lt;/p&gt;
&lt;p&gt;It does indeed seem that C_pin_HFXO and C_PCB have been neglected when calculating the required capacitance. The XTAL requires a C_L of 6pF while we currently do have a C_L in the range of 8pF to 9pF (assuming C_PCB between 0pF and 2pF).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/297465?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 11:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b76adc3-a730-4581-8701-d6cd3b607713</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
[quote user="m.wagner"]So, unfortunately I&amp;#39;m not sure what to make of this. It looks like there is something wrong, but what?[/quote]
&lt;p&gt;It seems clear that this is clock related, but not exactly how. Did you by any chance test with&amp;nbsp;NRF_CLOCK_LF_SRC_SYNTH? In that case the LF clock and HF clock would use the same clock source so&amp;nbsp;there will not be any drift. Perhaps it is somehow related to &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_146.html"&gt;erratum 146&lt;/a&gt;&amp;nbsp;though I do not immediately see how.&lt;/p&gt;
&lt;p&gt;Update: There is a confirmed bug in the SoftDevice where it does not account for drift between HF clock and LF clock in the internal scheduler. I do not immediately see how it relates to this specific case as the SoftDevice only use the RTC and no timer in timeslots, so it would be up to the application to handle this drift, which it does. There may be something here, though.&lt;/p&gt;
[quote user="m.wagner"]I&amp;#39;m not sure I agree entirely - at least from my &amp;quot;black box perspective&amp;quot;: the softdevice still signals NRF_EVT_RADIO_SESSION_IDLE at this point, so it does react somehow at the time the timeslot should have ended. So it looks like it should know that the application did not respect the time.[/quote]
&lt;p&gt;Yes, you are right. It is the applications responsibility to clean up so that it have not configured any interrupts that will happen after the end of the timeslot on the restricted peripherals (like TIMER0). I agree that is not clearly stated though.&lt;/p&gt;
[quote user="m.wagner"] I was more trying to find out when and how this is triggered (through software? PPI? from what interrupt priority? Is there any difference in handling if temperature variation triggers the calibration?[/quote]
&lt;p&gt;The decision on whether to calibrate or not depends on configuration as discussed. In the implementation a calibration timer fires regularly and the temperature is checked. If temperature&amp;nbsp;has changed more than the threshold, calibration will be performed. If not a check if calibration has been skipped for too long is done, and if it is, calibration is performed. The actual calibration is done in the same way regardless of why it was triggered.&lt;/p&gt;
&lt;p&gt;The calibration itself consists of very little code, most importantly these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Request the HFXO clock&lt;/li&gt;
&lt;li&gt;Check if HW clock is running (it takes some time to start). If it is continue, if not configure an interrupt on the HFCLOCK started event so that calibration can start when clock is ready&lt;/li&gt;
&lt;li&gt;Apply first part of workaround for &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_192.html"&gt;erratum 192&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Trigger NRF_CLOCK-&amp;gt;TASKS_CAL&lt;/li&gt;
&lt;li&gt;Wait for calibration to finish signaled by an&amp;nbsp;NRF_CLOCK-&amp;gt;EVENTS_DONE.&lt;/li&gt;
&lt;li&gt;Do last part of erratum 192 workaround&lt;/li&gt;
&lt;li&gt;release HFXO clock&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Another thing... When initializing the mesh stack with&amp;nbsp;mesh_stack_init(), you pass a&amp;nbsp;mesh_stack_init_params_t instance which has a member core.lfclksrc. Is this correctly configured, with the correct accuracy?&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/297375?ContentTypeID=1</link><pubDate>Wed, 03 Mar 2021 08:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da0dcb16-bca8-4492-82f6-fe684938d3e8</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/297149#297149"] I have not found any reports of similar issues with the LFRC. Using regular calibration it should stay within +-500 ppm. If there is an issue here I would expect many other customers seeing a set of other issues as well (for instance missing BLE timing etc.), so it is a bit strange. We have found the default configuration, which you have described, to be good enough to not cause problems while not calibrating too often (in order to save power). I am not able to explain why this does not seem to be the case here. If it was just one device then I would suspect an issue with that specific device, but that doe snot seem to be the case her based on earlier discussions - though there are variations.&amp;nbsp;[/quote]
&lt;p&gt;So, unfortunately I&amp;#39;m not sure what to make of this. It looks like there is something wrong, but what?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Could there be an issue with the custom module or environment? I can&amp;#39;t imagine that there are temperature variations &amp;gt; 0.5&amp;deg;C within 4s - that would really be unexpected, but I&amp;#39;m not too knowledgeable about hardware these days...&lt;/li&gt;
&lt;li&gt;We did not observe any unexpected behaviour during BLE connections - which sometimes are established for rather long durations! In fact, it looked like the application runs more stable while BLE is active.&lt;/li&gt;
&lt;li&gt;As I said, it looks like PCA20020 shows this same occasional behaviour from time to time as well!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;EDIT: I just reverted back to the recommended original LFCLK configuration and traced NRF_CLOCK-&amp;gt;EVENTS_DONE and it does not look like any temperature drifts are detected, the calibration is done at the 8s interval throughout!&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/297149#297149"]I see your point, but that is not in line with how the timeslot API is designed. The application does not signal that the timeslot has ended (sd_radio_session_close() is only called when a session ends, i.e. when the app no longer needs timeslots), so the SoftDevice does not know that the app did not respect the time until something unexpectedly happens when it should not.[/quote]
&lt;p&gt;I&amp;#39;m not sure I agree entirely - at least from my &amp;quot;black box perspective&amp;quot;: the softdevice still signals NRF_EVT_RADIO_SESSION_IDLE at this point, so it does react somehow at the time the timeslot should have ended. So it looks like it should know that the application did not respect the time.&lt;/p&gt;
&lt;p&gt;But if this is normal behaviour, I think it would be great if it were somehow documented! I don&amp;#39;t think I&amp;#39;ve seen this documented in the Softdevice specification.&lt;/p&gt;
&lt;p&gt;Of course the SD would assert as soon as the application accesses one of the MWU-protected peripherals or something similar.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/70252/softdevice-assert-at-pc-0x15810-s132-7-2-0-rtc-clock-drift-when-using-timeslot/297149#297149"]Calibration is done in hardware. The SoftDevice simply starts the HFXO and triggers the CAL task (NRF_CLOCK_TASK_CALL) to trigger calibration and HW does the rest.[/quote]
&lt;p&gt;Sorry, I was not clear with my question. I&amp;#39;m aware of the NRF_CLOCK-&amp;gt;TASK_CAL, but I was more trying to find out when and how this is triggered (through software? PPI? from what interrupt priority? Is there any difference in handling if temperature variation triggers the calibration?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m just trying to figure out if there are any negative impacts if the LF-clock is calibrated more often besides power consumption. (We are not running on battery and have the RADIO receiver enabled almost all of the time - so power consumption is not an issue.)&lt;/p&gt;
&lt;p&gt;Sorry for the unending amount of questions, but this whole issue does bother us quite a bit, as we still lack understanding in cause and details. I&amp;#39;m really happy to have found the workaround with more frequent calibration, thogh, it&amp;#39;s quite relieving to be honest, as it looks like even the most &amp;quot;sensitive&amp;quot; device we have around is now running rock-solid.&lt;/p&gt;
&lt;p&gt;Thank you for your patience &amp;amp; support. Best regards,&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/297149?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 11:43:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a551a87-53b7-469f-938b-f0284af15c7d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;These are very interesting findings.&lt;/p&gt;
[quote user="m.wagner"]How do I determine the &amp;quot;correct&amp;quot; values for NRF_SDH_CLOCK_LF_RC_CTIV and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV? Why were the defaults not appropriate?[/quote]
&lt;p&gt;This is a good question. I have not found any reports of similar issues with the LFRC. Using regular calibration it should stay within +-500 ppm. If there is an issue here I would expect many other customers seeing a set of other issues as well (for instance missing BLE timing etc.), so it is a bit strange. We have found the default configuration, which you have described, to be good enough to not cause problems while not calibrating too often (in order to save power). I am not able to explain why this does not seem to be the case here. If it was just one device then I would suspect an issue with that specific device, but that doe snot seem to be the case her based on earlier discussions - though there are variations.&amp;nbsp;&lt;/p&gt;
[quote user="m.wagner"]Why does the softdevice not assert once it knows that timeslot is actually overstretched, but only fire the IDLE event? The COMPARE0-IRQ of RTC0 is enabled and active, after all so the possibility for the assert is there! This looks like unexpected behaviour by the softdevice.[/quote]
&lt;p&gt;I see your point, but that is not in line with how the timeslot API is designed. The application does not signal that the timeslot has ended (sd_radio_session_close() is only called when a session ends, i.e. when the app no longer needs timeslots), so the SoftDevice does not know that the app did not respect the time until something unexpectedly happens when it should not.&lt;/p&gt;
[quote user="m.wagner"]How is the RC oscillator calibrated? Does this run in hardware entirely or is there code running, taking care of this? Is this running in interrupt handlers and at what priority? With As far as I understand , a temperature measurement is required if NRF_SDH_CLOCK_LF_RC_TEMP_CTIV is &amp;gt;= 2. Would be great if you could elaborate on this![/quote]
&lt;p&gt;Calibration is done in hardware. The SoftDevice simply starts the HFXO and triggers the CAL task (NRF_CLOCK_TASK_CALL) to trigger calibration and HW does the rest.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/296971?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 16:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3048b0d8-e3c1-4c8e-bbd0-80b318048e24</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I looked a bit more into the behaviour of the device when this issue occurs - and tried to implement a workaround, too.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tracing RTC0-&amp;gt;EVENTS_COMPARE[1]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I did trace RTC0-&amp;gt;EVENTS_COMPARE[1] via PPI with a logic analyzer, because this seems to be the timing reference the softdevice uses to assert timeslots are ended in time. &lt;br /&gt;&lt;br /&gt;It looks like the compare event fires significantly earlier than normal when the unexpected behaviour occurs even though the timeslot was extended to the exact same duration as every other timeslot before.&lt;br /&gt;&lt;br /&gt;I noticed that during undisrupted/regular operation, the period of RTC0-&amp;gt;EVENTS_COMPARE[1] is in the range of 10&amp;#39;000&amp;#39;457us to 10&amp;#39;000&amp;#39;486us, with a standard deviation of ~28us, whereas the compare-event that occurs right before the unexpeced IDLE event fires is raised after e.g. 9&amp;#39;999&amp;#39;971us, so 486us earlier than the earliest of the other compare events, which is an order of magnitude more.&lt;br /&gt;&lt;br /&gt;It looks like NRF_EVT_RADIO_SESSION_IDLE is then invoked within around 60us of RTC0-&amp;gt;EVENTS_COMPARE[1], so lookis like this is triggered from the RTC0 COMPARE1 interrupt handler.&lt;br /&gt;&lt;br /&gt;See the following logic analyzer trace (attached as Saleae Logic 2 data file, too).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/869x411/__key/communityserver-discussions-components-files/4/2021_2D00_03_2D00_01-17_5F00_09_5F00_14_2D00_Logic-2-_5B00_Logic-Pro-8-_2D00_-Disconnected_5D00_.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sd_2D00_assert_2D00_rtc_2D00_debug_2D00_1.zip"&gt;devzone.nordicsemi.com/.../sd_2D00_assert_2D00_rtc_2D00_debug_2D00_1.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Tracing RTC0-&amp;gt;CC[1]&lt;/strong&gt;&lt;br /&gt;I also looked at how the RTC0-&amp;gt;CC[1] value changes when timeslots are extended. The nRF SDK for Mesh timeslot extension algorithm initially (when invoking sd_radio_request()) tries to reserve a &amp;quot;short&amp;quot; timeslot of 14000us duration and then tries to match the previous length by extending it up to 10&amp;#39;000&amp;#39;000us (without BLE activity this will be achieved).&lt;br /&gt;&lt;br /&gt;I tried to see whether there were any anomalies when calculating the CC[1] value for the RTC, but did not observe any. When receiving NRF_RADIO_CALLBACK_SIGNAL_TYPE_START, the difference between NRF_RTC0-&amp;gt;COUNTER and NRF_RTC0-&amp;gt;CC[1] is consistently at 459, corresponding to around 14&amp;#39;000us. After extending to 10s (NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEED), the difference is consistently at 327681, corresponding to ~10&amp;#39;000&amp;#39;000us. This is no different for the timeslot in which the observed issue occurs.&lt;br /&gt;&lt;br /&gt;Looking at another logic analyzer trace where I also traced the LFCLK, (RTC0 TICK event via PPI), I came to the conclusion that &lt;strong&gt;the reason of the early compare event apparently seems to be RC clock drift that is larger than assumed.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The amount of ticks counted from about the time the timeslot extension concluded up to the point the RTC0 COMPARE1 event fires was consistently higher for the period after which NRF_EVT_RADIO_SESSION_IDLE is invoked, while the measured duration was consistently significantly shorter.&lt;/p&gt;
&lt;p&gt;I attached the Logic trace (recorded with the below workaround active, so there are no Softdevice asserts happening...)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sd_2D00_assert_2D00_measure_2D00_rtc_2D00_tick.zip"&gt;devzone.nordicsemi.com/.../sd_2D00_assert_2D00_measure_2D00_rtc_2D00_tick.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I figured - since I can actually detect the unexpected NRF_EVT_RADIO_SESSION_IDLE, I could try a workaround where I just force stop all my timeslot activity (while disabling the MWU region that watches RADIO and TIMER0...) and re-order a new timeslot. It seems to be a viable workaround since in our application this issue seems to occur only or at least mostly while there is no BLE activity (advertising or connection) at all.&lt;br /&gt;&lt;br /&gt;A &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72177/nrf-sdk-for-mesh-bug-in-timeslot_timer-c-variable-set-but-never-cleared"&gt;bug in the timeslot_timer&lt;/a&gt; prevented the workaround to work from the get-go, but once I figured that out, it started to look promising.&lt;br /&gt;&lt;br /&gt;I do not include the code here, since it&amp;#39;s probably a bad idea to actually use it...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:150%;"&gt;&lt;strong&gt;The actual solution&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;As it turns out, the actual solution to the problem seems to be way simpler and less hacky than my workaround. &lt;strong&gt;It looks like for some reason the &amp;quot;normal&amp;quot; values of NRF_SDH_CLOCK_LF_RC_CTIV (16, corresponding to 4 seconds) and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV (2, corresponding to force recalibration every second interval - so I assume 8 seconds), seem to not result in an accurate enough LFCLK&lt;/strong&gt;. I reduced NRF_SDH_CLOCK_LF_RC_CTIV to 4 (corresponding to every second) and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 0 (corresponding to recalibration at every interval). &lt;br /&gt;&lt;br /&gt;So far, this has been running stable even on the &amp;quot;wonkier&amp;quot; devices. So two questions remain:&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;How do I determine the &amp;quot;correct&amp;quot; values for NRF_SDH_CLOCK_LF_RC_CTIV and NRF_SDH_CLOCK_LF_RC_TEMP_CTIV? Why were the defaults not appropriate?&lt;/li&gt;
&lt;li&gt;Why does the softdevice not assert once it knows that timeslot is actually overstretched, but only fire the IDLE event? The COMPARE0-IRQ of RTC0 is enabled and active, after all so the possibility for the assert is there! This looks like unexpected behaviour by the softdevice.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;EDIT:&lt;/p&gt;
&lt;p&gt;3. How is the RC oscillator calibrated? Does this run in hardware entirely or is there code running, taking care of this? Is this running in interrupt handlers and at what priority? With As far as I understand , a temperature measurement is required if NRF_SDH_CLOCK_LF_RC_TEMP_CTIV is &amp;gt;= 2. Would be great if you could elaborate on this!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/296471?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2021 10:09:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f54f4a99-f95d-4b64-a363-b66585d094de</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thanks for the traces.&lt;/p&gt;
&lt;p&gt;Regarding the assert at&amp;nbsp;PC=0x24f24 that can happen if&amp;nbsp;the application used too much time in the callback handler as the SoftDevice timing may be thrown off.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/296464?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2021 09:45:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d603683-4547-4224-8b2b-a70a10522d18</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks. Just for the sake of completeness, I also attached the Saleae Logic 2 traces I screenshotted further up. The first one is from our application, the second one from the mesh example.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/softdevice_2D00_assert_2D00_logic_2D00_traces.zip"&gt;softdevice_assert_logic_traces.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Additionally, I&amp;#39;d like to ask what the Softdevice assert at PC=0x24f24 indicates? I assume this is the one that gets raised when the timeslot was ended too late? I very rarely see this one (as opposed to the &amp;quot;regular&amp;quot; one at PC=0x15810) and assume it can be averted by the workaround suggested above, increasing TIMESLOT_END_SAFETY_MARGIN_US.&lt;/p&gt;
&lt;p&gt;Looking forward to the results of the team &amp;amp; thanks for your support!&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/296309?ContentTypeID=1</link><pubDate>Thu, 25 Feb 2021 14:35:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d3f759d-1149-4fbb-b28f-028f75f58b78</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thanks for the update. I will forward the information to the team.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/296072?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2021 15:12:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9f4b67e-801c-4162-b97c-a9e405ccf4fc</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;While trying to reproduce another timeslot-related issue (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/71360/softdevice-event-handler-continuously-called-with-nrf_evt_radio_blocked"&gt;Softdevice event handler continuously called with NRF_EVT_RADIO_BLOCKED&lt;/a&gt;), I found another angle by which I seem to be able to reproduce the same basic issue.&lt;/p&gt;
&lt;p&gt;Hung Bui, the support engineer in the linked devzone entry, convinced me to try to reproduce the other issue based on his &lt;a href="https://github.com/NordicPlayground/nrf51-ble-micro-esb-uart"&gt;nRF52 BLE - ESB Timeslot example&lt;/a&gt;. Doing this, I managed to reproduce this issue here, wehere the softdevice event handler unexpectedly gets called with NRF_EVT_RADIO_SESSION_IDLE on an nRF52DK (PCA10040).&lt;/p&gt;
&lt;p&gt;Steps to reproduce with his example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get the linked example to run as per its instructions.&lt;/li&gt;
&lt;li&gt;Attach the patch attached to this comment&lt;/li&gt;
&lt;li&gt;Run the example&lt;/li&gt;
&lt;li&gt;Connect a BLE central to the peripheral (advertising as &amp;quot;Nordic_UART&amp;quot;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This will result in NRF_EVT_RADIO_SESSION_IDLE being invoked within a few milliseconds after establishing the BLE connection.&lt;/p&gt;
&lt;p&gt;The patch contains the following changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Added and enabled GPIOs for debugging:
&lt;ul&gt;
&lt;li&gt;P0.03 - Signals whether device is in timeslot&lt;/li&gt;
&lt;li&gt;P0.04 - High while in radio callback (signal ID is indicated by repeated toggles)&lt;/li&gt;
&lt;li&gt;P0.28 - Set when callback_action set to NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND, cleared on EXTEND_SUCCEEDED or EXTEND_FAILED&lt;/li&gt;
&lt;li&gt;P0.29 - High while serving SIGNAL_TYPE_TIMER0&lt;/li&gt;
&lt;li&gt;P0.30 - High while in softdevice signal handler (signal ID is indicated by repeated toggles)&lt;/li&gt;
&lt;li&gt;P0.31 - High while serving TIMER0 interrupt where timeslot is ended.&lt;/li&gt;
&lt;li&gt;P0.25 - Indicates EXTEND_SUCCEEDED.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reduced the length_us parameter in the radio request to 3800 in case a timeslot is BLOCKED or CANCELED.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/example_2D00_uart_2D00_esb_2D00_timeslot.patch"&gt;devzone.nordicsemi.com/.../example_2D00_uart_2D00_esb_2D00_timeslot.patch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, the issue occurs immediately if the length_us of the requested timeslot is reduced from 5000 to 3800. I did not play around with the values any further!&lt;/p&gt;
&lt;p&gt;I hope this may help you in getting to the cause of this issue! In the meantime, I&amp;#39;ll see if increasing the minimum length requested may resolve it in may application!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/295950?ContentTypeID=1</link><pubDate>Wed, 24 Feb 2021 07:57:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1b918da-9ddb-44ff-93d1-3c70615ed2aa</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;This is a tricky one it seems. I cannot promise anything at this point but I have forwarded this to the team. I will let you know if they make any progress.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/295915?ContentTypeID=1</link><pubDate>Tue, 23 Feb 2021 16:50:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53e97d78-9dce-4daf-a0bb-494bf83cabf3</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I tried to subsequently increase the&amp;nbsp;TIMESLOT_END_SAFETY_MARGIN_US until either not observing any Softdevice Asserts or reaching 1000us. Unfortunately, I did always observe the described softdevice assert at some point. It looks like increasing it reduces the probability of the asserts&amp;#39; occurence, though which is at least something.&lt;/p&gt;
&lt;p&gt;Still hoping for a definitive solution!&lt;/p&gt;
&lt;p&gt;Thank you &amp;amp; best regards,&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/295549?ContentTypeID=1</link><pubDate>Mon, 22 Feb 2021 11:31:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50697709-3c0b-4e55-b097-263a44af08cf</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;The team has looked more into this but have not got to the bottom of it. They suggest that you can try to&amp;nbsp;they increase TIMESLOT_END_SAFETY_MARGIN_US in steps of 100 us upto 1000 us.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/293099?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 13:23:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:244347fa-b2d5-46c4-bef1-76da19650207</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;I am sorry this has take&amp;nbsp;some time. I have talked to the mesh team and they are looking into this. I will let you know when they make some progress or have some interesting observations to share.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/293084?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 12:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cb8dd20-ffc5-4c5e-8046-e5f5157588a5</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s been 10 days since I heard from you and tought I should ask if there are any new findings or estimates as to when there could be!&lt;/p&gt;
&lt;p&gt;The issue is somewhat urgent as it concerns a product which is running in pre-production testing and the frequent resets - all due to the described softdevice asserts - seriously impact the usability of the product.&lt;/p&gt;
&lt;p&gt;Thank you for your help &amp;amp; best regards,&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/291234?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 10:29:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a65d769-f5c2-4a5f-b81d-fd294922cba0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thank you for that input, that could be relevant. I have forwarded it to the mesh team.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/291123?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 17:12:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e9c924d-b3de-4a85-8aac-ae8ed6cd875a</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Just a small update: I&amp;#39;m not 100% certain, but it looks like the issue occurs more often on PCA20020 (Thingy:52) than on PCA10040 (nRF52 DK). I did only notice this when testing our application firmware; did not test with the mesh example I provided.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:75%;"&gt;(Could the core issue possibly be related to the accuracy of the 32MHz crystal in use? PCA10040 has a 10ppm crystal, PCA20020 a 40ppm crystal and as I mentioned earlier, our custom module uses a 30ppm crystal. With both &amp;quot;lower accuracy&amp;quot; devices showing said behaviour more frequently.)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps in narrowing down the issue.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/290787?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 14:39:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9124b988-b924-42dd-b03d-04c25876d9c5</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Okay, thanks for the feedback!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/290786?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 14:38:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cec8e55b-e633-4346-8582-55ad46674876</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;The mesh team has started to look at it, but they have not made any interesting observations yet nor found a solution. I will let you know when they make progress of if they have some time estimates.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/290660?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 08:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f6d376f-7ed9-4d2a-bbfe-d63d414af1fc</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Do you have any news concerning this issue?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;-mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/289520?ContentTypeID=1</link><pubDate>Fri, 15 Jan 2021 19:51:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfb5456e-1b20-4fd1-97a8-e6f9421aedb3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for all the details. I have not made any progress on this today, but I will ask the mesh team to look at it and let you know what they find.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/289281?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 16:13:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:495360b9-1715-45a3-98c1-d805993a0fb0</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;In the meantime I was able to reproduce this issue with nRF SDK for Mesh 4.2.0 and a slightly modified beaconing example.&lt;/p&gt;
&lt;p&gt;I attached a patch file which will apply the modifications I made.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/mesh_5F00_sd_5F00_assert_5F00_proof.patch"&gt;devzone.nordicsemi.com/.../mesh_5F00_sd_5F00_assert_5F00_proof.patch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Summary of my changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Adapted to my target hardware (disabled LEDs, buttons, use LF_SRC = RC)&lt;/li&gt;
&lt;li&gt;Disabled beacon advertising and provisionee&lt;/li&gt;
&lt;li&gt;Enabled and slightly modified the debug pins from core/debug_pins.h&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The debug pins used in this configuration are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;P0.00 - (LF XTAL pin) - Signals whether device is in timeslot&lt;/li&gt;
&lt;li&gt;P0.01 - (LF XTAL pin) - High while in timeslot signal handler&lt;/li&gt;
&lt;li&gt;P0.06 - High while in BEARER_ACTION_TIMER_IRQHandler()&lt;/li&gt;
&lt;li&gt;P0.08 - High while in app_error_fault_handler()&lt;/li&gt;
&lt;li&gt;P0.09 - (NFCT pin) - High while TIMER0 IRQ is being served&lt;/li&gt;
&lt;li&gt;P0.10 - (NFCT pin) - High while in timeslot.c&amp;#39;s softdevice event handler&lt;/li&gt;
&lt;li&gt;P0.30 - Toggles on TIMER0-&amp;gt;EVENTS_COMPARE[0]&lt;/li&gt;
&lt;li&gt;P0.31 - Set to high by RADIO-&amp;gt;EVENTS_READY, to low by RADIO-&amp;gt;EVENTS_DISABLED.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see in the *.patch file attached, I ran the beaconing_nrf52832_xxAA_s132_7_0_1.emProject example in Segger Embedded Studio.&lt;/p&gt;
&lt;p&gt;The device I tested with is a custommade/proprietary RF-Module with an nRF52832-QFAA, no LF crystal and a Murata XRCMD32M000FXP53R0 30ppm HF-XTAL.&lt;/p&gt;
&lt;p&gt;Below you can see the corresponding trace I made with the logic analyser. As in the previous traces, around the point where the TIMER0-&amp;gt;EVENTS_COMPARE[0] should fire, the softdevice signal handler is invoked with event&amp;nbsp;NRF_EVT_RADIO_SESSION_IDLE. The next time the radio interrupt is triggered or something alike (the mesh&amp;#39;s scanner module is still running at this point), the example crashes with &lt;span style="font-family:courier new, courier;"&gt;Softdevice assert: 88044.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/667x318/__key/communityserver-discussions-components-files/4/sd_5F00_assert_5F00_mesh.png" /&gt;&lt;/p&gt;
&lt;p&gt;Concerning the frequency of this occurence: On this particular device I tested with, it seems to usually occur within the first 10 minutes of run time or so. On nRF52 DK devices (also configured to use LF_SRC = RC!), it seems to happen less frequently. Maybe once every couple of hours or so... So far, I have not yet been able to properly trace this on an nRF52 DK yet.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It would be great, if you could investigate this issue in more detail, as the smooth functioning of this timeslot code is essential to our application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Assert at PC=0x15810 (S132 7.2.0) / RTC clock drift when using timeslot</title><link>https://devzone.nordicsemi.com/thread/289003?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 16:54:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1a035e6-ac0b-4b28-ac4f-f1b6b8b60291</guid><dc:creator>m.wagner</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;No, it&amp;#39;s definitely running on the HFXO.&lt;/p&gt;
&lt;p&gt;In the meantime, I finally managed to look into it with a logic analyzer and could make an additional important finding: The issue occurs after the SoftDevice Event IRQ Handler has been invoked with NRF_EVT_RADIO_SESSION_IDLE.&lt;/p&gt;
&lt;p&gt;This is a trace of the event. You see that around the time the TIMER0 interrupt should fire via the signal handler, instead the SoftDevice Event IRQ is invoked with NRF_EVT_RADIO_SESSION_IDLE.&lt;/p&gt;
&lt;p&gt;Since this is unexpected and regular timeslot cleanup is omitted, my TIMER4 is still running on priority 0 and firing shortly after, triggering a RADIO IRQ via software.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/658x411/__key/communityserver-discussions-components-files/4/sd_5F00_assert.png" /&gt;&lt;/p&gt;
&lt;p&gt;The zoom in on the final part of the trace shows that the softdevice asserts immediately after said timer interrupt (confirming my previous assumptions):&lt;/p&gt;
&lt;p&gt;&lt;img height="509" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/sd_5F00_assert_5F00_zoom.png" width="647" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;To see what happens if the Interrupt causing the assertion is not running, I observe that... nothing happens. Nothing pertaining to timeslot activity is going on (see following trace):&lt;img height="542" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/sd_5F00_assert_5F00_no_5F00_hopping.png" width="535" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now I do not expect this event while a timeslot is ongoing - or better yet: the mesh team does not expect this event while a timeslot is ongoing. As I mentioned, the timeslot session is handled by a barely modified timeslot.c from nRF SDK for Mesh. The event handling:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case NRF_EVT_RADIO_SESSION_IDLE:
    /* As the SD events aren&amp;#39;t handled atomically, we could potentially run into this scenario:
     * - stop the timeslot -&amp;gt; SESSION_IDLE event pending, session_state is OPEN
     * - start the timeslot again from the same context -&amp;gt; session_state is RUNNING
     * - The SESSION_IDLE event is handled.
     * Closing the radio session now leads to unexpected behavior, as the user restarted
     * the timeslot already, expecting it to remain active.
     */
    if (m_current_timeslot.session_state == TS_SESSION_STATE_OPEN)
    {
        ASSERT_NRF_ERROR_CODE(sd_radio_session_close(), TS_CORE_ERR_SESSION_CLOSE);
    }
    break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The variable m_current_timeslot.session_state is set to TS_SESSION_STATE_RUNNING at this point, though - so nothing happens.&lt;/p&gt;
&lt;p&gt;A search of the DevZone also lead me to a user that seemingly had a similar issue with the actual nRF SDK for Mesh running:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50455/softdevice-assertion-failed-while-running-mesh/203384#203384"&gt;SOFTDEVICE: ASSERTION FAILED while running mesh.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately this was not followed up.&lt;/p&gt;
&lt;p&gt;To me it looks like some sort of race condition occuring in the softdevice. I&amp;#39;m not entirely sure what to make of the NRF_EVT_RADIO_SESSION_IDLE event in any case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>