<?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: How to place an array of constants in a flash? in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/How-to-place-an-array-of-constants-in-a-flash/m-p/194568#M8563</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Florijan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm won't pretend to be an expert on the subtities of C constants but I think that a 'definitiion' of a constant array without an initialisation is treated differently to one with. It's treated as a declaration rather than a definition.&amp;nbsp; You are free to define the array in another location - the const qualifier&amp;nbsp; on the declaration appears to be ignored for placement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I declare an _initialised_ constant array:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const unsigned char dummy[5] = {1};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it ends up in the ROM area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&lt;/P&gt;&lt;P&gt;const unsigned char dummy[5];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ends up in RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So - either initialise the array or use the @notation to place the array in Flash.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const unsigned char myData[10]@0x1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. Above tested with&amp;nbsp; CW v6.2.2?&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by pgo on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-06-28&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;11:19 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Jun 2009 08:17:27 GMT</pubDate>
    <dc:creator>pgo</dc:creator>
    <dc:date>2009-06-28T08:17:27Z</dc:date>
    <item>
      <title>How to place an array of constants in a flash?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/How-to-place-an-array-of-constants-in-a-flash/m-p/194567#M8562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am using&amp;nbsp; CodeWarrior 6.2. I can't put an array of constants in a flash when using Coldfire V1 mcu. It works very well with 8-bit s08 mcus. Can someone please tell me how to make it work with Coldfire V1 mcus also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, i want these array in a flash:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const char [8][200];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2009 02:15:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/How-to-place-an-array-of-constants-in-a-flash/m-p/194567#M8562</guid>
      <dc:creator>Florijan</dc:creator>
      <dc:date>2009-06-28T02:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to place an array of constants in a flash?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/How-to-place-an-array-of-constants-in-a-flash/m-p/194568#M8563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Florijan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm won't pretend to be an expert on the subtities of C constants but I think that a 'definitiion' of a constant array without an initialisation is treated differently to one with. It's treated as a declaration rather than a definition.&amp;nbsp; You are free to define the array in another location - the const qualifier&amp;nbsp; on the declaration appears to be ignored for placement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I declare an _initialised_ constant array:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const unsigned char dummy[5] = {1};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it ends up in the ROM area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&lt;/P&gt;&lt;P&gt;const unsigned char dummy[5];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ends up in RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So - either initialise the array or use the @notation to place the array in Flash.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const unsigned char myData[10]@0x1000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. Above tested with&amp;nbsp; CW v6.2.2?&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by pgo on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-06-28&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;11:19 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2009 08:17:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/How-to-place-an-array-of-constants-in-a-flash/m-p/194568#M8563</guid>
      <dc:creator>pgo</dc:creator>
      <dc:date>2009-06-28T08:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to place an array of constants in a flash?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/How-to-place-an-array-of-constants-in-a-flash/m-p/194569#M8564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear pgo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have found the solution. The catch was that the const array was put in to the flash correctly while the interface on the left side of a Codewarrior window reported increase in data instead of a code and I was thinking that it is placed in ram. Maybe this is a minor bug. Because it is only the case when using Coldfire V1 processors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jun 2009 23:26:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/How-to-place-an-array-of-constants-in-a-flash/m-p/194569#M8564</guid>
      <dc:creator>Florijan</dc:creator>
      <dc:date>2009-06-28T23:26:18Z</dc:date>
    </item>
  </channel>
</rss>

