<?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>execution profiling</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46355/execution-profiling</link><description>Hi, 
 we are developing on the nrf52840 using SES and SDK 15.0. This is a custom board. Softdevice is s140_nrf52_6.0.0_softdevice.hex 
 We are sampling distance with vl53l0x chips. The chips are sampled in a loop and the results smoothed and then written</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Apr 2019 05:15:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46355/execution-profiling" /><item><title>RE: execution profiling</title><link>https://devzone.nordicsemi.com/thread/183293?ContentTypeID=1</link><pubDate>Wed, 24 Apr 2019 05:15:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52149d94-f878-460b-a211-142685005dea</guid><dc:creator>paul</dc:creator><description>&lt;p&gt;hi Edvin,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; In trying to resolve this I simplified the code down. The for loop is not timer/interrupt driven - just normal flow of execution. It should enter the third if statement every 20ms unless something that is timer/interrupt driven is taking a long time. The flex_debugdata call simply writes that value - lastTime_ - startTime to a characteristic for debug purposes. It should be 20. However at steady state it is 37 - 38 hence the 17 to 18 ms lost.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I finally found where this extra time was going. Seems I had a couple of SDH logs enabled. With these switched off, the measurement timing comes back to 51.2hz or ~20ms&lt;/p&gt;
&lt;p&gt;Thanks for your help&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
&lt;p&gt;-&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: execution profiling</title><link>https://devzone.nordicsemi.com/thread/183171?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 14:20:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d413b89d-ba44-4fe2-8a72-b86f7d44da3a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Paul,&lt;/p&gt;
&lt;p&gt;It is a bit difficult to say without knowing what you do inside your&amp;nbsp;flex_DebugData(), and what other tasks your application is doing. Is there any more relevant information you can share?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]While in the loop&amp;nbsp;there are a steady stream of writes to a service characteristic. [/quote]
&lt;p&gt;Where are you sending data over BLE?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Without knowing anything about your application, from a power consumption point of view, it doesn&amp;#39;t look like you ever let your chip go to sleep. I don&amp;#39;t know whether this is a concern for you.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>