<?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>LPCXpresso IDEのトピックRe: Static string storage</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552540#M12349</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by atomicdog on Mon Oct 03 21:12:43 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;AVR compilers (most?) require you to use extensions like __flash or PROGMEM in order to place variables in flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCxpresso allows you to use const to place variables in flash even though technically const as described in the C standard doesn't have anything to do with storage location of variables.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:28:08 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:28:08Z</dc:date>
    <item>
      <title>Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552535#M12344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Mon Oct 03 19:21:32 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;On 8-bit AVRs if you declare a static string ie&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;const char myString[] = "Hello world";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The bytes are stored in flash and then copied to RAM by the startup code. This is presumably because instructions cannot access data in program memory space.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a major PITA because is eats RAM for no real reason. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this the case with LPC?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: const added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;______&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552535#M12344</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552536#M12345</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 Mon Oct 03 19:31:12 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In both cases you should try 'const char ...' :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552536#M12345</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552537#M12346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Mon Oct 03 20:23:27 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes that's true, I forgot. But on the AVR const does nothing but throw a compiler error if you have code that writes to the variable, it does not cause the storage to be in flash only.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What happens with the LPCs?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oops, I just noticed you said "yes", so even on the LPCs you loose RAM for no reason.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;______&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552537#M12346</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552538#M12347</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 Mon Oct 03 20:45:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;With constant qualifier compiler will set values at compile time and therefore store it in ROM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That doesn't 'waste' RAM if you don't need to change this value :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552538#M12347</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552539#M12348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Mon Oct 03 21:07:56 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;set values at compile time and therefore store it in ROM.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then that's the answer, a const does [B]not[/B] use any RAM. I thought your "yes" was in answer to my first question which was basically "Does it use RAM?"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The GCC compiler for AVRs does, the ROM (actually flash) contents for all const "variables" are copied into RAM at start up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now one more question then, when you say "ROM" do you mean EEPROM or flash?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;______&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552539#M12348</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552540#M12349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by atomicdog on Mon Oct 03 21:12:43 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;AVR compilers (most?) require you to use extensions like __flash or PROGMEM in order to place variables in flash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCxpresso allows you to use const to place variables in flash even though technically const as described in the C standard doesn't have anything to do with storage location of variables.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552540#M12349</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552541#M12350</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 Mon Oct 03 21:19:41 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;My Imagecraft AVR Compiler stores constants also in ROM :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And ROM means Flash here, the place where the program is stored.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552541#M12350</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552542#M12351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by graynomad on Mon Oct 03 21:45:59 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;OK, thanks guys. I have a project in mind that needs quite large lookup tables and if the LPC worked the same way that I'm used to it would not be a goer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can tell I'm new to LPCs, it will take me a while to get up to speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;______&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552542#M12351</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Static string storage</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552543#M12352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by gbm on Tue Oct 04 03:38:53 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;All reasonable compilers for LPC1xxx store const by default in Flash (ROM), not in RAM. Period. Your constants will NOT occupy RAM.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:28:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-string-storage/m-p/552543#M12352</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:28:10Z</dc:date>
    </item>
  </channel>
</rss>

