<?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: Moving code to ITC memory in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Moving-code-to-ITC-memory/m-p/1320910#M15757</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;It seems that the reason is not where you place your code, for the code&lt;/P&gt;
&lt;P&gt;is simple, I think the factor is the memory access caused by the for(volatile int i...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Crist&lt;/P&gt;</description>
    <pubDate>Tue, 10 Aug 2021 07:55:39 GMT</pubDate>
    <dc:creator>crist_xu</dc:creator>
    <dc:date>2021-08-10T07:55:39Z</dc:date>
    <item>
      <title>Moving code to ITC memory</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Moving-code-to-ITC-memory/m-p/1316805#M15617</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to move code to ITC memory and verify that it indeed greatly improves performance.&lt;/P&gt;&lt;P&gt;I looked at the linker scripts generated by MCU Xpresso, and learned that the code decorated with "RamFunction" is moved to ram.&lt;/P&gt;&lt;P&gt;I added this code to a standard MCU Xpresso generated project for my RT 1020 EVK board&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        GPIO1-&amp;gt;DR ^= (1UL &amp;lt;&amp;lt; 15);
        for (volatile int i=0; i&amp;lt;100000; i++)
        {
        	Nonsense();
        }
        GPIO1-&amp;gt;DR ^= (1UL &amp;lt;&amp;lt; 15);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the Nonsense function here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Nonsense()
{
    GPIO1-&amp;gt;DR ^= (1UL &amp;lt;&amp;lt; 23);
    for (volatile int i=0; i&amp;lt;1000; ++i)
    {
	__asm volatile ("nop");
    }
    GPIO1-&amp;gt;DR ^= (1UL &amp;lt;&amp;lt; 23);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran my baseline test, and in my logic analyzer I could see that every outer loop took roughly 1.8s.&lt;/P&gt;&lt;P&gt;Next I decorated both main and Nonsense() with the ramfunction macro as follows:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;RAMFUNCTION_SECTION_CODE(void Nonsense())
{
    GPIO1-&amp;gt;DR ^= (1UL &amp;lt;&amp;lt; 23);
    for (volatile int i=0; i&amp;lt;1000; ++i)
    {
  	__asm volatile ("nop");
    }
    GPIO1-&amp;gt;DR ^= (1UL &amp;lt;&amp;lt; 23);
}

RAMFUNCTION_SECTION_CODE(int main(void))
{
    ...
    ...
}
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But the results are the same. It takes roughly 1.8seconds to complete the outer loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I completely missing the obvious here? Can somebody tell me how to get the performance boost I am trying to achieve by moving code to ITC? Or explain why this isn't showing any improvement at all?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 15:37:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Moving-code-to-ITC-memory/m-p/1316805#M15617</guid>
      <dc:creator>bp1979</dc:creator>
      <dc:date>2021-08-02T15:37:14Z</dc:date>
    </item>
    <item>
      <title>Moving code to ITC memory</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Moving-code-to-ITC-memory/m-p/1320622#M15739</link>
      <description>&lt;P&gt;Hello Bp1979,&lt;/P&gt;
&lt;P&gt;Have you followed the steps in section 17.13.5 of the MCUXpresso IDE User Guide?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/user-guide/MCUXpresso_IDE_User_Guide.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/user-guide/MCUXpresso_IDE_User_Guide.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;As for performance depending on the kind of memory where the code resided, AN12437 (link below) and the following Knowledge Base document does cover the differences in speed between them.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/RT-4-Digit-10xx-11xx-12xx/iMXRTxxxx-Memory-Performance-ITCM-DTCM-L1-CACHE-LMEM-CACHE-OCRAM/ta-p/1109993" target="_blank"&gt;https://community.nxp.com/t5/RT-4-Digit-10xx-11xx-12xx/iMXRTxxxx-Memory-Performance-ITCM-DTCM-L1-CACHE-LMEM-CACHE-OCRAM/ta-p/1109993&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN12437.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/application-note/AN12437.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope that this information helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Gustavo&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 23:05:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Moving-code-to-ITC-memory/m-p/1320622#M15739</guid>
      <dc:creator>gusarambula</dc:creator>
      <dc:date>2021-08-09T23:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Moving code to ITC memory</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Moving-code-to-ITC-memory/m-p/1320910#M15757</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;It seems that the reason is not where you place your code, for the code&lt;/P&gt;
&lt;P&gt;is simple, I think the factor is the memory access caused by the for(volatile int i...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Crist&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 07:55:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Moving-code-to-ITC-memory/m-p/1320910#M15757</guid>
      <dc:creator>crist_xu</dc:creator>
      <dc:date>2021-08-10T07:55:39Z</dc:date>
    </item>
  </channel>
</rss>

