<?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: Problem: C Strings occupy RAM space in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161645#M4502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the target processor is a ColdFire V1 (QE128),&amp;nbsp;I´m using CodeWarrior V6.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´m using a lot of strings in my code, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;strstr(myBuffer, "MyString");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I compile the proyect, in the proyect window says that I have a lot of RAM usage, while only are declared a few variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the .MAP file, these strings appears into the .rodata section.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I avoid this behaivor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2009 05:28:46 GMT</pubDate>
    <dc:creator>jluis</dc:creator>
    <dc:date>2009-12-16T05:28:46Z</dc:date>
    <item>
      <title>Problem: C Strings occupy RAM space</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161643#M4500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a lot of strings in my code, and I suppose that this string must remain into flash mamory. But the strings are occuping a lot of RAM space. How can I avoid that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks an best regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 02:19:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161643#M4500</guid>
      <dc:creator>jluis</dc:creator>
      <dc:date>2009-12-16T02:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: C Strings occupy RAM space</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161644#M4501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which processor are you targeting? Which tools are using?&lt;/P&gt;&lt;P&gt;And how do you use the string constants? Can you provide a sample application?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 04:50:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161644#M4501</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2009-12-16T04:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: C Strings occupy RAM space</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161645#M4502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the target processor is a ColdFire V1 (QE128),&amp;nbsp;I´m using CodeWarrior V6.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´m using a lot of strings in my code, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;strstr(myBuffer, "MyString");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I compile the proyect, in the proyect window says that I have a lot of RAM usage, while only are declared a few variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the .MAP file, these strings appears into the .rodata section.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I avoid this behaivor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 05:28:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161645#M4502</guid>
      <dc:creator>jluis</dc:creator>
      <dc:date>2009-12-16T05:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: C Strings occupy RAM space</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161646#M4503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a new stationery project for the V1 QE128 and used a string in main.c.&lt;/P&gt;&lt;P&gt;The string gets allocated in flash just as code is, so I wonder if you have some other special setup or if your diagnosis that the string ends up using RAM is not correct and the RAM is eaten up by something else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I got out of the xmap file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
  000007D8 0000000C .text   _ewl_exit (librt.a abort_exit.o   )  000007E4 00000009 .rodata @8 (main.c)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;As you see the string ends up in .rodata just after the last code function from .text .&lt;/P&gt;&lt;P&gt;&amp;nbsp;As you see the strings also ending up in .rodata (good) is the issue that your lcf places .rodata inproperly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Daniel&lt;/P&gt;&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:07:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problem-C-Strings-occupy-RAM-space/m-p/161646#M4503</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2020-10-29T09:07:04Z</dc:date>
    </item>
  </channel>
</rss>

