<?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: declaring array of constants in ROM in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/declaring-array-of-constants-in-ROM/m-p/222823#M8826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would make the declaration const too:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern const unsigned int page_table[31];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, if you have it extern, then do *not* use static for the implementation:&lt;/P&gt;&lt;P&gt;const unsigned int page_table[] = {.........};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 May 2013 16:14:05 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2013-05-02T16:14:05Z</dc:date>
    <item>
      <title>declaring array of constants in ROM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/declaring-array-of-constants-in-ROM/m-p/222822#M8825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using a 9S08QE8 and wish to declare an array of constant ints into ROM and be able to reference them from another module.&lt;/P&gt;&lt;P&gt;I have used :&lt;/P&gt;&lt;P&gt;const static unsigned int page_table[] = {.........};&lt;/P&gt;&lt;P&gt;in the .h files with&lt;/P&gt;&lt;P&gt;extern unsigned int page_table[31];&lt;/P&gt;&lt;P&gt;to declare it to other modules.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get linker error L1823 as well as an out of RAM error (because it has put it in RAM).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone point me in the right direction. I have spent all afternnon trying to get this right. It sounds simple enough.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2013 16:00:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/declaring-array-of-constants-in-ROM/m-p/222822#M8825</guid>
      <dc:creator>stevec</dc:creator>
      <dc:date>2013-05-02T16:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: declaring array of constants in ROM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/declaring-array-of-constants-in-ROM/m-p/222823#M8826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would make the declaration const too:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern const unsigned int page_table[31];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, if you have it extern, then do *not* use static for the implementation:&lt;/P&gt;&lt;P&gt;const unsigned int page_table[] = {.........};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2013 16:14:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/declaring-array-of-constants-in-ROM/m-p/222823#M8826</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2013-05-02T16:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: declaring array of constants in ROM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/declaring-array-of-constants-in-ROM/m-p/222824#M8827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That seems to have sorted it. Many thanks. I will need to understand what I did wrong so I don't make the same mistake again. Back to the books!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2013 06:55:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/declaring-array-of-constants-in-ROM/m-p/222824#M8827</guid>
      <dc:creator>stevec</dc:creator>
      <dc:date>2013-05-03T06:55:49Z</dc:date>
    </item>
  </channel>
</rss>

