<?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>LPCXpresso IDE中的主题 Re: GPIO too slow with CMSIS compiled with CodeRed</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562533#M16772</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yoko on Wed Mar 16 06:15:51 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Optimization is -O3 compiled in release mode, with debug disable. No jtag.&amp;nbsp; Just flash it and let run free.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;Note: This sample is toggling with 25MHz (LPC1769 /100MHz/Optimization: Optimize Most(-O3)) . &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you actually measure it with a scope ? I can't get that number compiled with CodeRed.&amp;nbsp; Ony comiple with mBed online compiler that I get 24MHz.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know all about writing optimized C code.&amp;nbsp; I need to know what caused the slow down in CodRed but not with mBed online compiler.&amp;nbsp; It must be something in the startup of CMSIS.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 02:14:13 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T02:14:13Z</dc:date>
    <item>
      <title>GPIO too slow with CMSIS compiled with CodeRed</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562530#M16769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yoko on Tue Mar 15 19:16:24 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I have been doing a test with GPIO.&amp;nbsp; Test is very simple.&amp;nbsp; Just an endless while loop toggling an I/O pin. Like bellow&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;while(1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPIO1-&amp;gt;FIOSET = (1 &amp;lt;&amp;lt; 31);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPIO1-&amp;gt;FIOCLR = (1 &amp;lt;&amp;lt; 31);
};&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code compile using mBed online compiler, I can achieve ~24MHz.&amp;nbsp; Meseaured with a scope on the pin.&amp;nbsp; Same code compiled with CodeRed CMSIS, with modified clock setting for 120MHz CPU.&amp;nbsp; I get only &amp;lt;11MHz.&amp;nbsp; With default CodeRed CMSIS settings, I only get about 2MHz.&amp;nbsp; The tests ran on same board of course.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can any one explain why and how performance can be improved ?&amp;nbsp; There must be some kind of settings that are missing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:14:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562530#M16769</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO too slow with CMSIS compiled with CodeRed</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562531#M16770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by atomicdog on Tue Mar 15 22:20:41 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;What optimization setting does each one use?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:14:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562531#M16770</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO too slow with CMSIS compiled with CodeRed</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562532#M16771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Wed Mar 16 04:12:41 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;Test is very simple.&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]No. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;There must be some kind of settings that are missing.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Yes, as John mentioned before it's Optimization.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]Default setting in Debug Configuration is 'Optimization: None(-O0)'. So it's easier for you to use Disassembly view and 'Instruction Stepping Mode' (little 'i-&amp;gt;' icon) to step through your code (and try to understand what's happening). Debugging is not possible in mbed and therefore no need to reduce optimization level while debugging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In Disassembly view you can see how optimization works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
//LED
#define LED&amp;nbsp; (1 &amp;lt;&amp;lt; 13)
#define LED_ON&amp;nbsp; LPC_GPIO2-&amp;gt;FIOSET=LED
#define LED_OFF LPC_GPIO2-&amp;gt;FIOCLR=LED
...
int main(void)
{
...
 LPC_GPIO2-&amp;gt;FIODIR |= LED;&amp;nbsp;&amp;nbsp; //set LED output
 while(1)
 {
&amp;nbsp; LED_ON;
&amp;nbsp; LED_OFF;
 }
 return 0;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;Disassembly view Optimization: None(-O0):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]LED_ON;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001ca &amp;lt;main+70&amp;gt;: movw r3, #49216 ; 0xc040&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001ce &amp;lt;main+74&amp;gt;: movt r3, #8201 ; 0x2009&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001d2 &amp;lt;main+78&amp;gt;: mov.w r2, #8192 ; 0x2000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001d6 &amp;lt;main+82&amp;gt;: str r2, [r3, #24]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LED_OFF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001d8 &amp;lt;main+84&amp;gt;: movw r3, #49216 ; 0xc040&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001dc &amp;lt;main+88&amp;gt;: movt r3, #8201 ; 0x2009&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001e0 &amp;lt;main+92&amp;gt;: mov.w r2, #8192 ; 0x2000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001e4 &amp;lt;main+96&amp;gt;: str r2, [r3, #28]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x000001e6 &amp;lt;main+98&amp;gt;: b.n 0x1ca &amp;lt;main+70&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]Disassembly view Optimization: Optimize Most(-O3):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]LPC_GPIO2-&amp;gt;FIODIR |= LED; //set LED output&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00000184 &amp;lt;main&amp;gt;: movw r2, #49216 ; 0xc040&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00000188 &amp;lt;main+4&amp;gt;: movt r2, #8201 ; 0x2009&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x0000018c &amp;lt;main+8&amp;gt;: ldr r3, [r2, #0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x0000018e &amp;lt;main+10&amp;gt;: orr.w r3, r3, #8192 ; 0x2000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00000192 &amp;lt;main+14&amp;gt;: str r3, [r2, #0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LED_ON;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00000194 &amp;lt;main+16&amp;gt;: mov.w r3, #8192 ; 0x2000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x00000198 &amp;lt;main+20&amp;gt;: str r3, [r2, #24]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LED_OFF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x0000019a &amp;lt;main+22&amp;gt;: str r3, [r2, #28]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;0x0000019c &amp;lt;main+24&amp;gt;: b.n 0x198 &amp;lt;main+20&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Result:[LIST=1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]Some values (like 1&amp;lt;&amp;lt;13) are loaded in registers, so less instructions in while loop makes your toggling faster.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]If this registers are needed for something more important, compiler will step back to load them and don't waste valuable registers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/LIST]Note: This sample is toggling with 25MHz (LPC1769 /100MHz/Optimization: Optimize Most(-O3)) .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:14:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562532#M16771</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO too slow with CMSIS compiled with CodeRed</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562533#M16772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yoko on Wed Mar 16 06:15:51 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Optimization is -O3 compiled in release mode, with debug disable. No jtag.&amp;nbsp; Just flash it and let run free.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;Note: This sample is toggling with 25MHz (LPC1769 /100MHz/Optimization: Optimize Most(-O3)) . &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you actually measure it with a scope ? I can't get that number compiled with CodeRed.&amp;nbsp; Ony comiple with mBed online compiler that I get 24MHz.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know all about writing optimized C code.&amp;nbsp; I need to know what caused the slow down in CodRed but not with mBed online compiler.&amp;nbsp; It must be something in the startup of CMSIS.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:14:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562533#M16772</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO too slow with CMSIS compiled with CodeRed</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562534#M16773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Wed Mar 16 06:37:19 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Have you actually measure it with a scope ?&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sure, my dog is too old to smell it :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;...CodeRed CMSIS, with modified clock setting for 120MHz... &lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you measured it with a scope ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:14:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562534#M16773</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO too slow with CMSIS compiled with CodeRed</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562535#M16774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yoko on Wed Mar 16 06:52:40 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I think i got some thing.&amp;nbsp; It's related to how the project was create.&amp;nbsp; I recreate a new C project and get good results. Same code copy &amp;amp; paste over.&amp;nbsp; The first test was created as C++ project.&amp;nbsp; I am going to try to find what is the different.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:14:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562535#M16774</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO too slow with CMSIS compiled with CodeRed</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562536#M16775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by yoko on Wed Mar 16 07:10:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I got it.&amp;nbsp; In the C++ project the project settings of the C portion wasn't set.&amp;nbsp; After putting the the same settings everything is fine.&amp;nbsp; So for C++ projects, both C &amp;amp; C++ setting has to be configured even though the code is .cpp (not .c). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I got I/O arround 30MHz :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:14:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/GPIO-too-slow-with-CMSIS-compiled-with-CodeRed/m-p/562536#M16775</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:14:15Z</dc:date>
    </item>
  </channel>
</rss>

