<?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 Is it possible to force code into a non-standard section? in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/Is-it-possible-to-force-code-into-a-non-standard-section/m-p/370691#M2850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to use Processor Expert AND be able to force a few functions into a special memory area? I am facing the two following problems:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I can create a new memory area using the "generate linker file" option of processor expert. I can also define the selected code to go into a special section using the "section" attribute, but I cannot find a way to allocate that section into the specified memory area while at the same time keeping the basic linker file created by Processor Expert. Is it possible to either add a special linker file to deal with just that code, or to modify the Processor Expert linker file in a way that won't be obliterated every time I regenerate the PE code?&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the specified functions are not explicitly called by any module, they are not linked in to the executable, even if I use the "used" attribute. I would like to keep the "remove unused sections" option of the linker, but disable it just for these few functions. Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Dec 2014 14:55:05 GMT</pubDate>
    <dc:creator>brunopaillard</dc:creator>
    <dc:date>2014-12-22T14:55:05Z</dc:date>
    <item>
      <title>Is it possible to force code into a non-standard section?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Is-it-possible-to-force-code-into-a-non-standard-section/m-p/370691#M2850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to use Processor Expert AND be able to force a few functions into a special memory area? I am facing the two following problems:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I can create a new memory area using the "generate linker file" option of processor expert. I can also define the selected code to go into a special section using the "section" attribute, but I cannot find a way to allocate that section into the specified memory area while at the same time keeping the basic linker file created by Processor Expert. Is it possible to either add a special linker file to deal with just that code, or to modify the Processor Expert linker file in a way that won't be obliterated every time I regenerate the PE code?&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If the specified functions are not explicitly called by any module, they are not linked in to the executable, even if I use the "used" attribute. I would like to keep the "remove unused sections" option of the linker, but disable it just for these few functions. Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 14:55:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Is-it-possible-to-force-code-into-a-non-standard-section/m-p/370691#M2850</guid>
      <dc:creator>brunopaillard</dc:creator>
      <dc:date>2014-12-22T14:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to force code into a non-standard section?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Is-it-possible-to-force-code-into-a-non-standard-section/m-p/370692#M2851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bruno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About your questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1)&lt;/STRONG&gt; The best way is to generate Processor Expert linker file the first time and then disable Linker file generation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Linker_file.png"&gt;&lt;IMG alt="Linker_file.png" src="https://community.nxp.com/t5/image/serverpage/image-id/48735iF9B8684CF0B76EFA/image-size/large?v=v2&amp;amp;px=999" title="Linker_file.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you can make all the changes you want without worrying about PEx overwriting the linker file. About code and variables relocation you can refer to the next document in the community and MCU on Eclipse blog:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-101433" rel="noopener noreferrer" target="_blank"&gt;Relocating Code and Data Using the CW GCC Linker File for Kinetis&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank" title="http://mcuoneclipse.com/2012/11/01/defining-variables-at-absolute-addresses-with-gcc/"&gt;Defining Variables at Absolute Addresses with gcc | MCU on Eclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2)&lt;/STRONG&gt; Try using the linker &lt;STRONG&gt;KEEP&lt;/STRONG&gt; command, e.g:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14193930318788533" jivemacro_uid="_14193930318788533"&gt;
&lt;P&gt;&amp;nbsp; .my_section :&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.my_section))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; } &amp;gt; m_mysection&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is a KDS v2.0.0 project for your reference.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&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, 02 Nov 2020 13:14:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Is-it-possible-to-force-code-into-a-non-standard-section/m-p/370692#M2851</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2020-11-02T13:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to force code into a non-standard section?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Is-it-possible-to-force-code-into-a-non-standard-section/m-p/370693#M2852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solutions 1) and 2) work!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 12:58:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Is-it-possible-to-force-code-into-a-non-standard-section/m-p/370693#M2852</guid>
      <dc:creator>brunopaillard</dc:creator>
      <dc:date>2014-12-24T12:58:57Z</dc:date>
    </item>
  </channel>
</rss>

