<?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>CodeWarrior for MCUのトピックRe: Avoiding libs</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190191#M6830</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I tried the "Create sub-functions with commn code" option immediately but without success.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Do you know if there are any useful Application Notes for this subject??&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;//Bengt&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Oct 2008 12:33:38 GMT</pubDate>
    <dc:creator>BAN</dc:creator>
    <dc:date>2008-10-03T12:33:38Z</dc:date>
    <item>
      <title>Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190186#M6825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In my project I'm trying to separate two code blocks as&amp;nbsp;much a possible and this is done by &lt;STRONG&gt;not&lt;/STRONG&gt; sharing functions between the blocks. This is easy to fulfill in the C code but the compiler sometimes decides to use lib functions as _FPCMP and _LCMP from ansibi.lib, out of my control. Is there any way to avoid these function calls and force the compiler to use them as inline functions??&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;//BAN&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 21:12:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190186#M6825</guid>
      <dc:creator>BAN</dc:creator>
      <dc:date>2008-10-01T21:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190187#M6826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Ban,&lt;BR /&gt;&lt;BR /&gt;Which cpu are you targeting? S12? S08?&lt;BR /&gt;It's not possible in general. Optimizing for speed may use less runtime calls. There is also a message which can be set to a warning with #pragma MESSAGE so you don't have to look for runtime calls but the compiler tells you.&lt;BR /&gt;&lt;BR /&gt;Why do you split up your application into two parts? If it is in order to implement a loader and a application which can be replaced at runtime, then I would suggest to split up those two separate pieces into separate elf files/build targets/applications to make 100% sure changing the application has no effect whatsoever on the loader. This way the interface between the loader and the application (entry point, interrupt handlers) have to be explicitly managed, but I think that has to be done actually anyway in the "single ELF for loader and app" setup case.&lt;BR /&gt;&lt;BR /&gt;I remember that there were some threads with this subject in the past in this forum.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 21:41:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190187#M6826</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-10-01T21:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190188#M6827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Daniel!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My target is S12 and you are quite right, I'm trying to split the code into a laoder and application part.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;We have also considered to split them into separe targets but thought that this will make it impossible to debug the application in the debugger. Maybe it's not a problem, we just don't now the trick.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Do you remember when the threads covering this subject where active?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;//Bengt ANdersson&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2008 13:17:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190188#M6827</guid>
      <dc:creator>BAN</dc:creator>
      <dc:date>2008-10-02T13:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190189#M6828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;There is a compiler option ""Create sub-functions with common code". If you disable this, I think you will get rid of those functions entirely.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2008 21:18:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190189#M6828</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-10-02T21:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190190#M6829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Actually that is a different topic, that is a compiler optimization which only changes the internals of a function. Disabling it can help quite a bit to easy debugging, but the compiler will use runtime routines independently of this.&lt;BR /&gt;&lt;BR /&gt;A note to debugging a loader and an app at once. I always thought that once the loader works fine, you would never ever change it and there should not be much to debug. A few assembly instructions at each interrupt entry for the redirection maybe, but in the end the app code and the loader code should be quite separate.&lt;BR /&gt;However with the most resent HC12 tools (V4.7) it is now possible to load the debug information from multiple elf files. I never used it (needed to use it). Here's the snippet from the release notes of 4.7.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;List of new Features&lt;BR /&gt;&amp;gt;--------------------&lt;BR /&gt;&amp;gt;- Added support for loading multiple executable files and symbol tables&lt;BR /&gt;&amp;gt; (additional option ADD_SYSMBOLS in LOAD command).&lt;BR /&gt;&amp;gt;&amp;nbsp; Only the entry point of the first loaded file will be used to initialize the program counter (PC).&lt;BR /&gt;&lt;BR /&gt;Here's a thread which matches the subject (its about HC08, but its the same topic)&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=2144" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=2144&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here's another one which might be of interest.&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=16BITCOMM&amp;amp;message.id=441" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=16BITCOMM&amp;amp;message.id=441&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=1220" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=1220&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=2149" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CW816COMM&amp;amp;message.id=2149&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2008 23:10:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190190#M6829</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-10-02T23:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190191#M6830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I tried the "Create sub-functions with commn code" option immediately but without success.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Do you know if there are any useful Application Notes for this subject??&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;//Bengt&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2008 12:33:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190191#M6830</guid>
      <dc:creator>BAN</dc:creator>
      <dc:date>2008-10-03T12:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190192#M6831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;For the moment the interrupt handling feels tricky for me. Can you give me some further explanation to your expression "A few assembly instructions at each interrupt entry".&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;//Bengt&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Oct 2008 20:31:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190192#M6831</guid>
      <dc:creator>BAN</dc:creator>
      <dc:date>2008-10-03T20:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding libs</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190193#M6832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello Ban,&lt;/DIV&gt;&lt;DIV&gt;It's simple to separate areas of code using the linker and the #pragma command... here's how it works:&lt;/DIV&gt;&lt;DIV&gt;in the linker you can create and seperate different segments:&lt;/DIV&gt;&lt;DIV&gt;SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;APPCODE &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp;0xC000 TO 0xEFFF;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOOT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp; READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xF000 TO 0xFF2F;&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;//and then you select what code is placed where:&lt;/DIV&gt;&lt;DIV&gt;PLACEMENT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_ROM, ROM_VAR, STRINGS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp; APPCODE;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOOTCODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO BOOT;&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;once this is set, code will be placed by default into the appcode area, but anything that you want to be placed into the boot code should have this before the function:&lt;/DIV&gt;&lt;DIV&gt;#pragma CODE_SEG&amp;nbsp; BOOTCODE&lt;/DIV&gt;&lt;DIV&gt;void function(void){}&lt;/DIV&gt;&lt;DIV&gt;and once you want to return to the app code, return it to the default value:&lt;/DIV&gt;&lt;DIV&gt;#pragma CODE_SEG DEFAULT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This same principle also applies for RAM(DATA_SEG) and constants(CONST_SEG)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;fleik&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 04:11:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Avoiding-libs/m-p/190193#M6832</guid>
      <dc:creator>fleik</dc:creator>
      <dc:date>2008-10-22T04:11:56Z</dc:date>
    </item>
  </channel>
</rss>

