<?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: Warning: gcc optim issue with some cmsis drivers in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560894#M16071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fariouche on Wed Sep 05 13:51:40 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using lpcxpresso's gcc (until the flasher's issue is sorted)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please discard this thread... I think I was confused by the way gdb "jumps" in optimized versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue was an invalid compiler flag.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:19:11 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:19:11Z</dc:date>
    <item>
      <title>Warning: gcc optim issue with some cmsis drivers</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560890#M16067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fariouche on Sun Sep 02 08:50:28 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all,&amp;nbsp; I was debugging the CAN (I'm using nxp's cmsis implementation lpc17xx_can.c)&amp;nbsp; I'm compiling with Os optimization flag. This triggers reordering of code for optimizations... This is fine most of the time, but in some case this can lead to a disaster (or almost)&amp;nbsp;&amp;nbsp; __attribute__((optimize("O0"))) should be used in front of some functions. This is the case for the can_setBaudrate function!&amp;nbsp; WHat happens is that the optimizer puts "CANx-&amp;gt;MOD = 0;" to return to normal mode before actually writting to the BTR register (the line just above, CANx-&amp;gt;BTR&amp;nbsp; = ) From a pure C perspective, this is perfectly fine, gcc has no idea that the order here is important!&amp;nbsp; I've forced the optim flag to O0 for this function and the CAN init function (just to be sure, don't need optimized init functions)&amp;nbsp; Most likely this must be used in other files! (all functions for example that disables/enables interrupts)&amp;nbsp; Hope this helps&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560890#M16067</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Warning: gcc optim issue with some cmsis drivers</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560891#M16068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fariouche on Sun Sep 02 09:39:41 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;well, I don't 100% get it, as all the fields are declared volatile...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe I was confused by gdb...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560891#M16068</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Warning: gcc optim issue with some cmsis drivers</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560892#M16069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by CodeRedSupport on Sun Sep 02 14:26:50 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;There are no known optimisation issues with correctly written code. Please post your code, and describe what you think the compiler is doing wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From an earlier posting, I think you said you were using a different compiler. Please confirm that you are using the compiler that ships with LPCXpresso.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560892#M16069</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Warning: gcc optim issue with some cmsis drivers</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560893#M16070</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 Sun Sep 02 14:52:01 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Writing MOD register after BTR register isn't causing any problems with LPCXpresso here. I'm using this sequence since years with -O0 (Debug) and -Os (Release) optimization :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560893#M16070</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Warning: gcc optim issue with some cmsis drivers</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560894#M16071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fariouche on Wed Sep 05 13:51:40 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using lpcxpresso's gcc (until the flasher's issue is sorted)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please discard this thread... I think I was confused by the way gdb "jumps" in optimized versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue was an invalid compiler flag.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Warning-gcc-optim-issue-with-some-cmsis-drivers/m-p/560894#M16071</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:11Z</dc:date>
    </item>
  </channel>
</rss>

