<?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/"><channel><title>How can you make code run faster? Analysing micro-performance with the nRF52</title><link>/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><description>Working on fast calculation of CRCs I have an algorithm which uses a precalculated fixed lookup table to process data 1 byte at a time generating a 32-bit CRC. The calculation it&amp;#39;s actually doing if the current CRC is C and the next byte is b is
C =</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Wed, 14 Jun 2023 08:47:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>EAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Very Nice!&amp;nbsp; [emoticon:9b06bfad0e6a482e801e5eb8fd9025d6]&lt;br /&gt;Surprised you haven&amp;#39;t gotten more upvotes.&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Mon, 24 Apr 2017 05:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>Andrzej Kuros</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;is the cpu cache turned on by default when using nRF SDK 13 with softdevice s132?&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Thu, 16 Feb 2017 19:22:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>butch</dc:creator><slash:comments>0</slash:comments><description>&lt;pre&gt;#include &amp;quot;nrf.h&amp;quot;

#ifdef NRF52
    NRF_NVMC-&amp;gt;ICACHECNF=0x01;
#endif
&lt;/pre&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Wed, 19 Oct 2016 07:48:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>David Garc&amp;#237;a Polo</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;quot;Turning the CPU cache on (NVIC-&amp;gt;ICACHECNF=0x01)  is wrong.&amp;quot;&lt;/p&gt;
&lt;p&gt;Should be &amp;quot;Turning the CPU cache on (NVMC-&amp;gt;ICACHECNF=0x01)&lt;/p&gt;
&lt;p&gt;Is there a button to edit a blog post?&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Thu, 15 Sep 2016 12:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>Susheel Nuguru</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Oh yes, I remember that you told me you wrote this in pure assembly. I was thinking that this might be collision in bus trying to access same slave (could happen because of piplelining). I agree that there is a possibility like you say that this could be because of the switching.&lt;/p&gt;
&lt;p&gt;Move data and code to two different blocks (RAM slaves) and access them with two different buses (code with ICODE and data with DCODE).This should eliminate collision if it did not improve.&lt;/p&gt;
&lt;p&gt;Move data and code to same block and access them using ICODE. This it should have been switching between busses.&lt;/p&gt;
&lt;p&gt;PS: Sorry for too many edits, there is no &amp;quot;minor edit&amp;quot; checkbox here in blogs.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Thu, 15 Sep 2016 11:47:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>RK</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Thanks Aryan, do you mean stack pointer or do you mean data pointer, because the stack, apart from the start/end of the routine, isn&amp;#39;t used? My guess was it was the data read (in the 0x20000000 block) vs the code read (in the 0x800000) block which was causing the stall because the bus had to switch between both blocks. Definitely however I could adjust the data pointer (and the lookup table pointers) so they are in the same block as the code, just need to subtract the fixed offset from both.&lt;/p&gt;
&lt;p&gt;Perhaps I&amp;#39;ll give that a try over the weekend.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Thu, 15 Sep 2016 11:38:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>Susheel Nuguru</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi RK,&lt;/p&gt;
&lt;p&gt;Very nice article and very good experiment.  You wrote&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;However, when the code is in CODERAM
(0x800000) for some reason there&amp;#39;s an
extra load stall, which I cannot
explain.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Running your code from CODERAM should not have affected the LSU part. I think that your stack pointer is pointing to the same RAM block in which your code resides. So when you are running code in CODERAM then there could be collisions because now we are accessing the same slave RAM block with two different busses. The collision could result in extra wait cycles. If you do this experiment with stack pointer pointing to some other RAM block than we should see the wait cycles for  LSU should atleast be same for both.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: How can you make code run faster? Analysing micro-performance with the nRF52</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-can-you-make-code-run-faster-analysing-micro-p</link><pubDate>Mon, 12 Sep 2016 12:46:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b940ae46-8719-4606-ab75-b848c6c8f689</guid><dc:creator>Wojtek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Thank you for that post, didn&amp;#39;t know about those DWT features. really nice analysis!&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=965&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>