<?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 linker question - passing value from linker to source or source to linker in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/linker-question-passing-value-from-linker-to-source-or-source-to/m-p/194594#M7131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I work with many different processors for different projects for different customers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to configure a standard&amp;nbsp; project.prm for the different micro's - - - -&lt;/P&gt;&lt;P&gt;but some of the memory (Ram and Flash) locations will be need to be different for different projects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I define the locations in the PRM file, how can I get the C source code to know what these are.&lt;/P&gt;&lt;P&gt;or if defined in a project_defines.C file can I get the linker to know about the settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as I am trying to reduce the number of places that things need to be changed - - - - -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Jim P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Mar 2011 05:40:59 GMT</pubDate>
    <dc:creator>Jim_P</dc:creator>
    <dc:date>2011-03-30T05:40:59Z</dc:date>
    <item>
      <title>linker question - passing value from linker to source or source to linker</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/linker-question-passing-value-from-linker-to-source-or-source-to/m-p/194594#M7131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I work with many different processors for different projects for different customers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to configure a standard&amp;nbsp; project.prm for the different micro's - - - -&lt;/P&gt;&lt;P&gt;but some of the memory (Ram and Flash) locations will be need to be different for different projects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I define the locations in the PRM file, how can I get the C source code to know what these are.&lt;/P&gt;&lt;P&gt;or if defined in a project_defines.C file can I get the linker to know about the settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as I am trying to reduce the number of places that things need to be changed - - - - -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Jim P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 05:40:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/linker-question-passing-value-from-linker-to-source-or-source-to/m-p/194594#M7131</guid>
      <dc:creator>Jim_P</dc:creator>
      <dc:date>2011-03-30T05:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: linker question - passing value from linker to source or source to linker</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/linker-question-passing-value-from-linker-to-source-or-source-to/m-p/194595#M7132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may define custom data segment and placement to that segment. Then just put your data to that segment using compiler pragmas:&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG placement&lt;/P&gt;&lt;P&gt;...data structs or varuiables...&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG default&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If needed, you can always get address of your custom data&amp;nbsp;using&amp;nbsp;address&amp;nbsp;operator (&amp;amp;variable).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get start or end of segment use linker defined symbols __SEG_START_xxx, __SEG_END_xxx, __SEG_SIZE_xxx, where xxx is placement. You need to declare those linker defined symbols in your code like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; extern int __SEG_START_xxx[];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case data has to be not initialized, change type&amp;nbsp;of segment in prm from READ_WRITE or READ_ONLY to NO_INIT .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 12:43:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/linker-question-passing-value-from-linker-to-source-or-source-to/m-p/194595#M7132</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-03-30T12:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: linker question - passing value from linker to source or source to linker</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/linker-question-passing-value-from-linker-to-source-or-source-to/m-p/194596#M7133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks that was what I was looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the back link from linker to source code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking at trying to have my code portable for different applications.&lt;/P&gt;&lt;P&gt;and was not liking the idea of setting a settings area in the linker and then having to&lt;/P&gt;&lt;P&gt;besure that the code knew where the area was.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The settings are the application settings and for debug and check out can be changed from the PC interface.&amp;nbsp;&lt;/P&gt;&lt;P&gt;this solves the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also looking at possible logging area in flash and this again would be application / processor dependent and not wanting to have to set this in different locations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;P&gt;Jim P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 03:12:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/linker-question-passing-value-from-linker-to-source-or-source-to/m-p/194596#M7133</guid>
      <dc:creator>Jim_P</dc:creator>
      <dc:date>2011-03-31T03:12:38Z</dc:date>
    </item>
  </channel>
</rss>

