<?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>CodeWarrior for MCUのトピックPlacing a lookup table in flash</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Placing-a-lookup-table-in-flash/m-p/1066017#M15419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using Codewarrior 6.3.&amp;nbsp; I can put a lookup table in RAM, but cannot seem to figure out the syntax to place it in ROM or flash memory.&amp;nbsp; Tried using extern, but then it seems the table is placed in ram and flash.&amp;nbsp; For placing the table in ram, I have this in the header along with the table values:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;static const unsigned char temperature[250] = { ... };&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Works fine in ram.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this to get the table in flash:&lt;/P&gt;&lt;P&gt;In the header:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;extern unsigned char temperature[250];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;then in the code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;extern unsigned char temperature[44] = { ...};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This places the table in both ram and flash!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct syntax to place a table in flash?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jul 2020 16:26:38 GMT</pubDate>
    <dc:creator>TomHoag</dc:creator>
    <dc:date>2020-07-20T16:26:38Z</dc:date>
    <item>
      <title>Placing a lookup table in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Placing-a-lookup-table-in-flash/m-p/1066017#M15419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using Codewarrior 6.3.&amp;nbsp; I can put a lookup table in RAM, but cannot seem to figure out the syntax to place it in ROM or flash memory.&amp;nbsp; Tried using extern, but then it seems the table is placed in ram and flash.&amp;nbsp; For placing the table in ram, I have this in the header along with the table values:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;static const unsigned char temperature[250] = { ... };&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Works fine in ram.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this to get the table in flash:&lt;/P&gt;&lt;P&gt;In the header:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;extern unsigned char temperature[250];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;then in the code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;extern unsigned char temperature[44] = { ...};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This places the table in both ram and flash!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct syntax to place a table in flash?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2020 16:26:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Placing-a-lookup-table-in-flash/m-p/1066017#M15419</guid>
      <dc:creator>TomHoag</dc:creator>
      <dc:date>2020-07-20T16:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Placing a lookup table in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Placing-a-lookup-table-in-flash/m-p/1066018#M15420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can allocate a constant variable at an absolute address using the @ modifier.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example allocating a constant called VersionNbr at address 0xF000 and initializing it to 2 is done as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const int VersionNbr @0xF000 = 2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Same notation can be used for a constant string as follows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; const char VersionStr[] @0xF000 ="Version 4.6";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if you don't use @, CW will allocate const variable&amp;nbsp;to&amp;nbsp; default const section automatically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If&amp;nbsp;this version number is not used anywhere in the application, you have to instruct the Linker to link it to the application even though it is not used.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is done specifying the constant name in the .prm file ENTRIES block.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ENTRIES&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; VersionNbr VersionStr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Last, please enable –Cc option in Compiler option setting panel.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 03:58:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Placing-a-lookup-table-in-flash/m-p/1066018#M15420</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2020-07-21T03:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Placing a lookup table in flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Placing-a-lookup-table-in-flash/m-p/1066019#M15421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jun!&amp;nbsp; Your solution saved me so much time!&amp;nbsp; Can you please provide a link to the document that has this information?&amp;nbsp; Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:25:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Placing-a-lookup-table-in-flash/m-p/1066019#M15421</guid>
      <dc:creator>TomHoag</dc:creator>
      <dc:date>2020-07-21T15:25:36Z</dc:date>
    </item>
  </channel>
</rss>

