<?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>Classic/Legacy CodeWarriorのトピックRe: Defining &amp; referencing static data structures in FLASH</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Defining-referencing-static-data-structures-in-FLASH/m-p/151003#M2085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I remember M*Core. One of those steam-powered processors. &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check out FAQ-28651 and FAQ-27630. Both deal with storing constants in ROM (flash). The first FAQ is for the HCS12(X) MCU, and the second is for a Power Architecture CPU, but maybe they'll give you some ideas. Sorry I cannot give you something specific on M*Core.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Nov 2009 22:34:13 GMT</pubDate>
    <dc:creator>J2MEJediMaster</dc:creator>
    <dc:date>2009-11-03T22:34:13Z</dc:date>
    <item>
      <title>Defining &amp; referencing static data structures in FLASH</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Defining-referencing-static-data-structures-in-FLASH/m-p/151002#M2084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm maintaining some old code for the M.Core MMC2114 in CodeWarrior 4.1 / 0622 (yes I have to shovel coal into the laptop to make it run!) and have hit a problem I can't work out the answer to, although I'm sure it's a simple thing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, within the code are arrays of strings, system messages, which are in several different languages. Currently the code loads one set of strings into a struct in RAM at runtime, something very roughly like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
void load english(){for(number of messages){copy ENGLISH_MESSAGE_NUMBER -&amp;gt; sys_messages[MESSAGE_NUMBER] }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So say we have 200 messages, we store N * 200 text strings (N = number of translations) in FLASH, and then copy one load of them to RAM at runtime. &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;IMG alt=":smileysurprised:" class="emoticon emoticon-smileysurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" title="Smiley Surprised" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;What I'd like to do is just define all the messages in the code and then point to their location in flash, so they could be addressed something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
sprintf(sys_messages[%LANG][MSG_HELLO]) // Prints "hello" in chosen language&lt;/PRE&gt;&lt;P&gt;So %LANG is a variable that indicates the selected language.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm stumped by is how to define this lot as a pile of static data rather than have to clog up the available RAM with a copy of data which is never going to change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I would add that I didn't write the original code, so I don't need to be told it makes no sense!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:54:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Defining-referencing-static-data-structures-in-FLASH/m-p/151002#M2084</guid>
      <dc:creator>FridgeFreezer</dc:creator>
      <dc:date>2020-10-29T08:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Defining &amp; referencing static data structures in FLASH</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Defining-referencing-static-data-structures-in-FLASH/m-p/151003#M2085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I remember M*Core. One of those steam-powered processors. &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check out FAQ-28651 and FAQ-27630. Both deal with storing constants in ROM (flash). The first FAQ is for the HCS12(X) MCU, and the second is for a Power Architecture CPU, but maybe they'll give you some ideas. Sorry I cannot give you something specific on M*Core.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2009 22:34:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Defining-referencing-static-data-structures-in-FLASH/m-p/151003#M2085</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2009-11-03T22:34:13Z</dc:date>
    </item>
  </channel>
</rss>

