<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Slow execution speed in Parallel EMC Nor flash in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820997#M32856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou" rel="nofollow noopener noreferrer" target="_blank"&gt;jeremyzhou&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;I have found a code for Cortex M3/M4 to get the instruction cycle count. The code I used is:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CYCCNT&amp;nbsp; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;SCB_DEMCR&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;reset_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DWT_CYCCNT&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xE0001004&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//address of the register&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DWT_CONTROL&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xE0001000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//address of the register&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_DEMCR&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xE000EDFC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//address of the register&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;SCB_DEMCR&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;SCB_DEMCR &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0x01000000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CYCCNT&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// reset the counter&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;start_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// enable the counter&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;stop_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// disable the counter&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;getCycles&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CYCCNT&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;


Inside &lt;SPAN class="token function"&gt;main&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;

&lt;SPAN class="token function"&gt;reset_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;start_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"nop"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;stop_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;DEBUGOUT&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Cycles: %d\r\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;getCycles&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am using 24 MHz oscillator configured to 72 MHz CPU clock, EMC clock, &amp;amp; Peripheral clock. Please try this and acknowledge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also came across a strange thing, when I have used 12 MHz crystal(not oscillator) instead of 24 MHz crystal that I was using, the instruction cycles in user app came down to almost 1/3rd of the previous with same frequency configuration. I don't understand this, though LPC4088 UM does recommend 12 MHz crystal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few more doubts which I read in ARM PrimeCell MultiPort Memory Controller documents:&lt;/P&gt;&lt;UL&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;If the memory bus is multiplexed externally, for example by using an EBI, the worst-case transfer latency is affected because the external bus is shared by multiple devices.&lt;/LI&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;AHB port 0 is the highest priority port, AHB port 3 is the lowest priority port.&lt;/LI&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;&amp;nbsp;Lower priority AHB memory ports can be locked out indefinitely if a higher priority AHB memory port continually performs memory requests.&lt;/LI&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;The memory controller AHB memory ports are prioritized. If a master connected to a HIGH priority port performs continuous transactions, lower priority ports are not able to access the bus until the higher priority port has completed its transactions.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Now I have connected FPGA to CS0, SRAM to CS1, &amp;amp; Nor Flash to CS3. Can you help me explain above statements in reference to my hardware connections. After reading this I was planning to swap FPGA &amp;amp; Nor-Flash &amp;amp; see what happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Priyank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2018 09:43:33 GMT</pubDate>
    <dc:creator>priyankb</dc:creator>
    <dc:date>2018-10-22T09:43:33Z</dc:date>
    <item>
      <title>Slow execution speed in Parallel EMC Nor flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820992#M32851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;I am using LPC4088 based custom board with Nor Flash(SST39VF3202C), SRAM(CY62157EV30LL) &amp;amp; FGPA all working on the EMC. The CPU, Peripheral &amp;amp; EMC all are working on 72 MHz.&lt;BR /&gt;A secondary USB custom bootloader is in internal Flash. The user code is stored in external Nor flash. Wait states are same as in "norflash_prog" in LPCOpen example code &amp;amp; also I enable buffer mode just before jumping to user application(which helped to improve execution speed).&lt;/P&gt;&lt;P&gt;I am able to store generated S19 file into external flash using USB bootloader &amp;amp; it runs as well but it executes very slowly. The whole program seems to be lagging even without delay.&lt;BR /&gt;Due to this I cannot generate timer interrupt of &amp;lt;(100 us)(which is near about 2.5 us in internal flash) &amp;amp; that too not precise.&lt;BR /&gt;The nor flash does not support page read mode so I will try S29GL064S which has page read mode &amp;amp; is also pin compatible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In many discussions I read that SPIFI based flash is faster than parallel nor flash. how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What else can I do? Any suggestions would be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;BR /&gt;Priyank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2018 11:50:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820992#M32851</guid>
      <dc:creator>priyankb</dc:creator>
      <dc:date>2018-10-03T11:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Slow execution speed in Parallel EMC Nor flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820993#M32852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="309495" data-username="priyankb" href="https://community.nxp.com/people/priyankb"&gt;Priyank Bhatt&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;When working with the same clock, in general, the parallel Nor flash has a greater execution speed than the SPIFI Nor flash.&lt;BR /&gt;To improve the performance, I'd like to suggest you increase the speed of the CPU and peripheral clock, or copy the application code to SRAM to run, etc.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2018 01:36:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820993#M32852</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-10-08T01:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Slow execution speed in Parallel EMC Nor flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820994#M32853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou"&gt;jeremyzhou&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;Thank you for replying.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;When working with the same clock, in general, the parallel Nor flash has a greater execution speed than the SPIFI Nor flash.&lt;/BLOCKQUOTE&gt;&lt;P&gt;I also thought parallel memory must be faster than serial even if the fact that SPIFI has a dedicated cache to improve speed. That is why we chose parallel flash over serial. I have kept clock at 72 MHz because that is closest I can go to EMC's limit of 80 MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have tested the code with every combination of clock configurations &amp;amp; a weird result came. When I increase the clock the execution actually becomes slower which logically should not happen. That is why I have a serious doubt on initialization of either EMC flash or clock. These are the observations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE height="297" style="border-color: #000000;" width="780"&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;CCLK&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;PCLK&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;EMC_CLK&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;Timer_Int(us)&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;delay(loop)&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;nop&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;24&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;24&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;24&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;35 - 45&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;48&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;48&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;48&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;60 - 90&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;50 - 60&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;30 - 55&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;72&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;72&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;72&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;120 - 140&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;120 - 140&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;80 - 90&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;96&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;48&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;96&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;330 - 350&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;260 - 280&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;220 - 230&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;96&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;96&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;96&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;280 - 350&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;250 - 280&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;240 - 260&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;120&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;60&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;120&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;330 - 350&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;250 - 270&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;200 - 220&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="height: 25px; width: 144.917px;"&gt;120&lt;/TD&gt;&lt;TD style="height: 25px; width: 110.283px;"&gt;60&lt;/TD&gt;&lt;TD style="height: 25px; width: 118.783px;"&gt;60&lt;/TD&gt;&lt;TD style="height: 25px; width: 137.617px;"&gt;330 - 350&lt;/TD&gt;&lt;TD style="height: 25px; width: 119.367px;"&gt;280 - 320&lt;/TD&gt;&lt;TD style="height: 25px; width: 106.033px;"&gt;230 - 250&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;To improve the performance, I'd like to suggest you increase the speed of the CPU and peripheral clock, or copy the application code to SRAM to run, etc.&lt;/BLOCKQUOTE&gt;&lt;P&gt;Our application is very big (~3-4MB), would it be feasible to copy it to SRAM &amp;amp; run from there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I jump from bootloader to user app into Nor flash does the code executes from Flash as Execute-in-Place or copy to internal SRAM and then execute?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to use compiler optimization options which has increased execution speed but then our user app doesn't go past splash screen(we are using emWin for LCD display).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have ordered a new flash from cypress with page read mode, since the current flash does not allow page read mode. Would that make a difference in the execution of code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Priyank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2018 05:11:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820994#M32853</guid>
      <dc:creator>priyankb</dc:creator>
      <dc:date>2018-10-08T05:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Slow execution speed in Parallel EMC Nor flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820995#M32854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I recently tried to find out the number of instruction cycles used in boot loader &amp;amp; same in the user application using DWT registers provided in Cortex M4 and found out that "nop" instruction uses 42 instruction cycles in boot loader code(internal flash) whereas it takes around 3500 instruction cycles in user application.&lt;/P&gt;&lt;P&gt;Also learned that if I decrease clock frequency the instruction cycles actually decreases. I calculated that 1 instruction cycle = 1 machine cycle = 1 clock cycle &amp;amp; the minimum time I get is same as instruction cycles/CPU clock frequency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE style="border-color: #000000; width: 561px;"&gt;&lt;TBODY&gt;&lt;TR style="height: 30px;"&gt;&lt;TD style="width: 75px; height: 30px;"&gt;CPU clock&lt;/TD&gt;&lt;TD style="width: 83px; height: 30px;"&gt;EMC clock&lt;/TD&gt;&lt;TD style="width: 101px; height: 30px;"&gt;Pripheral clock&lt;/TD&gt;&lt;TD style="width: 137px; height: 30px;"&gt;bootloader Ins cycles&lt;/TD&gt;&lt;TD style="width: 127px; height: 30px;"&gt;user app ins cycles&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 30px;"&gt;&lt;TD style="width: 75px; height: 30px;"&gt;24&lt;/TD&gt;&lt;TD style="width: 83px; height: 30px;"&gt;24&lt;/TD&gt;&lt;TD style="width: 101px; height: 30px;"&gt;24&lt;/TD&gt;&lt;TD style="width: 137px; height: 30px;"&gt;42&lt;/TD&gt;&lt;TD style="width: 127px; height: 30px;"&gt;1400-1500&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 30px;"&gt;&lt;TD style="width: 75px; height: 30px;"&gt;48&lt;/TD&gt;&lt;TD style="width: 83px; height: 30px;"&gt;48&lt;/TD&gt;&lt;TD style="width: 101px; height: 30px;"&gt;48&lt;/TD&gt;&lt;TD style="width: 137px; height: 30px;"&gt;42&lt;/TD&gt;&lt;TD style="width: 127px; height: 30px;"&gt;3200&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 30px;"&gt;&lt;TD style="width: 75px; height: 30px;"&gt;72&lt;/TD&gt;&lt;TD style="width: 83px; height: 30px;"&gt;72&lt;/TD&gt;&lt;TD style="width: 101px; height: 30px;"&gt;72&lt;/TD&gt;&lt;TD style="width: 137px; height: 30px;"&gt;42&lt;/TD&gt;&lt;TD style="width: 127px; height: 30px;"&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 30px;"&gt;&lt;TD style="width: 75px; height: 30px;"&gt;96&lt;/TD&gt;&lt;TD style="width: 83px; height: 30px;"&gt;48&lt;/TD&gt;&lt;TD style="width: 101px; height: 30px;"&gt;48&lt;/TD&gt;&lt;TD style="width: 137px; height: 30px;"&gt;42&lt;/TD&gt;&lt;TD style="width: 127px; height: 30px;"&gt;37259&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 30px;"&gt;&lt;TD style="width: 75px; height: 30px;"&gt;120&lt;/TD&gt;&lt;TD style="width: 83px; height: 30px;"&gt;60&lt;/TD&gt;&lt;TD style="width: 101px; height: 30px;"&gt;60&lt;/TD&gt;&lt;TD style="width: 137px; height: 30px;"&gt;42&lt;/TD&gt;&lt;TD style="width: 127px; height: 30px;"&gt;44000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone having any idea as to what I should do to improve my execution speed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Priyank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 04:02:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820995#M32854</guid>
      <dc:creator>priyankb</dc:creator>
      <dc:date>2018-10-22T04:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Slow execution speed in Parallel EMC Nor flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820996#M32855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-content-finding="Community" data-userid="309495" data-username="priyankb" href="https://community.nxp.com/people/priyankb"&gt;Priyank Bhatt&lt;/A&gt;&lt;/SPAN&gt;，&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;BR /&gt;I'm curious the testing flow you did, as according to the Cortex™-M4 Technical Reference Manual, nop instruction only cost 1 cycle. So I was wondering if you can share the more details about the testing procedure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76158i243AC298767A84A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;1) Our application is very big (~3-4MB), would it be feasible to copy it to SRAM &amp;amp; run from there?&lt;BR /&gt;-- I'm afraid not.&lt;BR /&gt;2) When I jump from bootloader to user app into Nor flash does the code executes from Flash as Execute-in-Place or copy to internal SRAM and then execute?&lt;BR /&gt;-- It would execute in the flash.&lt;BR /&gt;3) I have ordered a new flash from cypress with page read mode, since the current flash does not allow page read mode. Would that make a difference in the execution of code?&lt;BR /&gt;-- I think it can make a difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In further, you can consider using an SDRAM instead of Nor-flash, its speed definitely exceed the Nor-flash, meanwhile, you may need an additional SPIFI flash to store the application, as its size is a bit big (&amp;gt; 3 MB).&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 07:29:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820996#M32855</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-10-22T07:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Slow execution speed in Parallel EMC Nor flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820997#M32856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jeremyzhou" rel="nofollow noopener noreferrer" target="_blank"&gt;jeremyzhou&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;I have found a code for Cortex M3/M4 to get the instruction cycle count. The code I used is:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CYCCNT&amp;nbsp; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;SCB_DEMCR&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;reset_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DWT_CYCCNT&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xE0001004&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//address of the register&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DWT_CONTROL&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xE0001000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//address of the register&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_DEMCR&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xE000EDFC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//address of the register&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;SCB_DEMCR&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;SCB_DEMCR &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0x01000000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CYCCNT&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// reset the counter&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;start_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// enable the counter&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;stop_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CONTROL &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// disable the counter&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;getCycles&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DWT_CYCCNT&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;


Inside &lt;SPAN class="token function"&gt;main&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;

&lt;SPAN class="token function"&gt;reset_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;start_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;asm&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"nop"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;stop_timer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;DEBUGOUT&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Cycles: %d\r\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;getCycles&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am using 24 MHz oscillator configured to 72 MHz CPU clock, EMC clock, &amp;amp; Peripheral clock. Please try this and acknowledge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also came across a strange thing, when I have used 12 MHz crystal(not oscillator) instead of 24 MHz crystal that I was using, the instruction cycles in user app came down to almost 1/3rd of the previous with same frequency configuration. I don't understand this, though LPC4088 UM does recommend 12 MHz crystal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few more doubts which I read in ARM PrimeCell MultiPort Memory Controller documents:&lt;/P&gt;&lt;UL&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;If the memory bus is multiplexed externally, for example by using an EBI, the worst-case transfer latency is affected because the external bus is shared by multiple devices.&lt;/LI&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;AHB port 0 is the highest priority port, AHB port 3 is the lowest priority port.&lt;/LI&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;&amp;nbsp;Lower priority AHB memory ports can be locked out indefinitely if a higher priority AHB memory port continually performs memory requests.&lt;/LI&gt;&lt;LI class="jive_macro_quote jive-quote jive_text_macro"&gt;The memory controller AHB memory ports are prioritized. If a master connected to a HIGH priority port performs continuous transactions, lower priority ports are not able to access the bus until the higher priority port has completed its transactions.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Now I have connected FPGA to CS0, SRAM to CS1, &amp;amp; Nor Flash to CS3. Can you help me explain above statements in reference to my hardware connections. After reading this I was planning to swap FPGA &amp;amp; Nor-Flash &amp;amp; see what happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Priyank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 09:43:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820997#M32856</guid>
      <dc:creator>priyankb</dc:creator>
      <dc:date>2018-10-22T09:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Slow execution speed in Parallel EMC Nor flash</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820998#M32857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="309495" data-objecttype="3" href="https://community.nxp.com/people/priyankb"&gt;Priyank Bhatt&lt;/A&gt;&lt;/SPAN&gt;，&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;BR /&gt;1） I also came across a strange thing, when I have used 12 MHz crystal(not oscillator) instead of 24 MHz crystal that I was using, the instruction cycles in user app came down to almost 1/3rd of the previous with same frequency configuration. I don't understand this, though LPC4088 UM does recommend 12 MHz crystal.&lt;BR /&gt;-- Yes, it seems a bit weird.&lt;BR /&gt;2) Now I have connected FPGA to CS0, SRAM to CS1, &amp;amp; Nor Flash to CS3. Can you help me explain the above statements in reference to my hardware connections? After reading this I was planning to swap FPGA &amp;amp; Nor-Flash &amp;amp; see what happens.&lt;BR /&gt;-- For EMC module, I don't think the CSx are prioritized, however, you can give a try.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 04:43:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Slow-execution-speed-in-Parallel-EMC-Nor-flash/m-p/820998#M32857</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2018-10-23T04:43:35Z</dc:date>
    </item>
  </channel>
</rss>

