<?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>S12 / MagniV MicrocontrollersのトピックRe: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389277#M10901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gordon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nice idea with RAMHM, but RAMHM=1 bit description tells this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Accesses to $4000–$7FFF will be mapped to $0F_C000-$0F_FFFF in the global memory space (RAM area).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is correct, then 0x2000..0x3FFF and 0x6000..0x7FFF should be identical instances of the same physical RAM. So not 24k, but only 16k, right?&lt;/P&gt;&lt;P&gt;With RAMHM=1, fixing RPAGE to 0xB it is possible to have contiguous 20k RAM at 0x1000..0x5FFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Dec 2014 21:29:47 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2014-12-05T21:29:47Z</dc:date>
    <item>
      <title>Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389272#M10896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We write C code in an object oriented manner for our S12XE-based units.&lt;/P&gt;&lt;P&gt;This means that all the functions take pointers to data as arguments.&lt;/P&gt;&lt;P&gt;This way we produce nice, portable, reusable and testable code. And we have a lot of it.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We recently needed to create a multi-CAN router capability.&lt;/P&gt;&lt;P&gt;That meant that we needed to have a lot of message buffers of considerable size.&lt;/P&gt;&lt;P&gt;So we ended up having around 10kB of RAM consumed.&lt;/P&gt;&lt;P&gt;By default, only 8kB of non-paged RAM is available in the CodeWarrior project. &lt;/P&gt;&lt;P&gt;I added page FC to get additional 4kB of RAM (additionally to already available 8kB of non-paged area between 0x2000 and 0x4000 address space).&lt;/P&gt;&lt;P&gt;In linker file (.prm) this page is assigned to DEFAULT_RAM segment, so we have it like this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="plain" name="code"&gt;SEGMENTS&amp;nbsp; /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x2000 TO&amp;nbsp;&amp;nbsp; 0x3FFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROM_C000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xC000 TO&amp;nbsp;&amp;nbsp; 0xFEFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE08000 TO 0xE0BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE18000 TO 0xE1BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE28000 TO 0xE2BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE38000 TO 0xE3BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE48000 TO 0xE4BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE58000 TO 0xE5BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE68000 TO 0xE6BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xE78000 TO 0xE7BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_F8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xF88000 TO 0xF8BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_F9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xF98000 TO 0xF9BFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_FA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xFA8000 TO 0xFABFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_FB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xFB8000 TO 0xFBBFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_FC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xFC8000 TO 0xFCBFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_FE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xFE8000 TO 0xFEBFFF; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM_FC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0xFC1000 TO 0xFC1FFF; END&amp;nbsp; PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */ &amp;nbsp;&amp;nbsp;&amp;nbsp; _PRESTART, &amp;nbsp;&amp;nbsp;&amp;nbsp; STARTUP, &amp;nbsp;&amp;nbsp;&amp;nbsp; ROM_VAR, &amp;nbsp;&amp;nbsp;&amp;nbsp; STRINGS, &amp;nbsp;&amp;nbsp;&amp;nbsp; NON_BANKED, &amp;nbsp;&amp;nbsp;&amp;nbsp; COPY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp;&amp;nbsp; ROM_C000; &amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_ROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp;&amp;nbsp; PAGE_FE, PAGE_FC, PAGE_FB, PAGE_FA, PAGE_F9, PAGE_F8, PAGE_E7, PAGE_E6, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAGE_E5, PAGE_E4, PAGE_E3, PAGE_E2, PAGE_E1, PAGE_E0; &amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp;&amp;nbsp; RAM, RAM_FC; END&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got linked warning L1128: Cutting value _Range beg data member from 0xFC1000 to 0x1000.&lt;/P&gt;&lt;P&gt;This means that linker placed some RAM data into address 0x1000 instead of 0xFC1000 because no __FAR_DATA compilation macro has been added to compilation command. &lt;/P&gt;&lt;P&gt;Anyway this will work now because page FC is mapped to 0x1000 address so refering to data at address 0x1000 actually refers to data at address 0xFC1000. &lt;/P&gt;&lt;P&gt;But this will not work when we need more pages (FD and so on). &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to Technical Note TN 238 to use more RAM pages I should mark my data (variables) with special pragma like: &lt;/P&gt;&lt;PRE class="plain" name="code"&gt;#pragma DATA_SEG __RPAGE_SEG PAGED_RAM unsigned char rub_far_var; #pragma DATA_SEG DEFAULT &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE class="plain" name="code"&gt;#pragma DATA_SEG __GPAGE_SEG PAGED_RAM&amp;nbsp; unsigned char rub_far_var; #pragma DATA_SEG DEFAULT&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to tell compiler/linker to place that data into RAM pages. &lt;/P&gt;&lt;P&gt;This is not nice (portability) but acceptable. &lt;/P&gt;&lt;P&gt;What is not acceptable is that to reffer to this data with a pointer, that pointer has to be specially qualified like: &lt;/P&gt;&lt;PRE class="plain" name="code"&gt;unsigned char * __rptr ptr_on_far_var;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;or&lt;/P&gt;&lt;PRE class="plain" name="code"&gt;unsigned char *__far ptr_on_far_var;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means that all our libraries that use non-qualified ("normal") pointers will not work with data allocated to paged RAM. &lt;/P&gt;&lt;P&gt;I checked that and this is true, for data allocated to address 0xFC1020 its pointer inside one of our libraries will show address 0x1020... &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So effectively for us we can only reach 12kB of RAM memory even if we use S12XEP that has 64kB of RAM... &lt;SPAN aria-label="Plain" class="emoticon_plain emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Otherwise our libraries won't work. &lt;/P&gt;&lt;P&gt;It is not possible to rewrite those libraries to have (for example) far pointers because they will stop compiling on other targets (windows, linux, other MCUs)...&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did anyone of you faced this kind of problem? &lt;/P&gt;&lt;P&gt;Do you have any idea what to do now?&lt;/P&gt;&lt;P&gt;We are lucky we needed "only" 10kB. &lt;/P&gt;&lt;P&gt;I don't know what would happen if we needed more than 12kB of RAM...&lt;/P&gt;&lt;P&gt;But I know I need to figure something out because some new projects will require lot more RAM...&lt;/P&gt;&lt;P&gt;Should we start to think about looking for another MCU?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Waiting for your ideas.&lt;/P&gt;&lt;P&gt;Szymon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 15:25:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389272#M10896</guid>
      <dc:creator>mroczeks</dc:creator>
      <dc:date>2014-12-03T15:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389273#M10897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;It is not possible to rewrite those libraries to have (for example) far pointers because they will stop compiling on other targets (windows, linux, other MCUs)...&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not really true. There must be some target specific predefined macros enabled like __MWERKS__ or something. Then instead of __far you use some FAR macro, which using few #if #else's should be tuned for specific target. Not very nice, but doable and portable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 16:13:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389273#M10897</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2014-12-03T16:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389274#M10898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for commenting Edward :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we really can't do anything else than creating dedicated macro for pointer qualification? &lt;/P&gt;&lt;P&gt;I understand that it is possible to write new module this way but what I meant is that it is not possible to rewrite ALL our EXISTING libraries, seems like a nightmare... :smileyplain:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 08:29:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389274#M10898</guid>
      <dc:creator>mroczeks</dc:creator>
      <dc:date>2014-12-04T08:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389275#M10899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try to use large memory model? Code will be slower, but data pointers will be "far" by default. You existing code should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S12XE project wizard shows large memory model grayed, use custom instead and keep settings on the next wizards page default. You should verify memory model looking at compiler command line string, -Ml should be there. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 08:41:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389275#M10899</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2014-12-04T08:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389276#M10900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt; font-family: 'courier new', courier;"&gt;Szymon,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt; font-family: 'courier new', courier;"&gt;The S12XE has a neat feature that allows the lower fixed page of Flash (0x4000 - 0x7fff) to be replaced with RAM. This allows access of 24K of contiguous RAM in the local map from 0x2000 - 0x7fff. Setting the ROMHM and RAMHM bits in the MMCCTL1 register will replace the Flash with RAM.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;The RAM segment definition would change to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x2000 TO&amp;nbsp;&amp;nbsp; 0x7FFF;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;In the compiler options you would need to set the 'MAP' option as shown here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="MapRAM.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/47885i7B9FAE15A0B5AF3D/image-size/large?v=v2&amp;amp;px=999" role="button" title="MapRAM.png" alt="MapRAM.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;I believe setting this option will automatically set up the MMCCTL1 register in the startup code, but you should check.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;You&lt;/SPAN&gt;&lt;SPAN style="font-size: 19px; font-family: 'courier new', courier;"&gt; also&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt; need to make sure that a segment definition for Flash in the 0x4000 - 0x7fff area does not exist in the .prm file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;Note that this does not require the use of the Large memory model.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;Gordon&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 20:06:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389276#M10900</guid>
      <dc:creator>GordonD</dc:creator>
      <dc:date>2014-12-05T20:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389277#M10901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gordon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nice idea with RAMHM, but RAMHM=1 bit description tells this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Accesses to $4000–$7FFF will be mapped to $0F_C000-$0F_FFFF in the global memory space (RAM area).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is correct, then 0x2000..0x3FFF and 0x6000..0x7FFF should be identical instances of the same physical RAM. So not 24k, but only 16k, right?&lt;/P&gt;&lt;P&gt;With RAMHM=1, fixing RPAGE to 0xB it is possible to have contiguous 20k RAM at 0x1000..0x5FFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 21:29:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389277#M10901</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2014-12-05T21:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389278#M10902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'courier new', courier;"&gt;Edward,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'courier new', courier;"&gt;No, there is 24K of RAM available in the local map from 0x2000 - 0x7fff and if the RPAGE window isn't needed to access the remaining RAM (it could still be accessed via GPAGE addressing), a total of 28K is available from 0x1000 - 0x7fff if the RPAGE register is set to 0xf9 and not changed. Take a look at these two tables from Section 3.4.2.5, Memory Configuration, of the MC9S12XE-Family Reference Manual Rev. 1.25:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="RAMHM.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/47892i43F6D97662E4AD28/image-size/large?v=v2&amp;amp;px=999" role="button" title="RAMHM.png" alt="RAMHM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;Gordon&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 22:05:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389278#M10902</guid>
      <dc:creator>GordonD</dc:creator>
      <dc:date>2014-12-05T22:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing more than 8kB RAM with object oriented C code for S12XE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389279#M10903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gordon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Dec 2014 06:49:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Accessing-more-than-8kB-RAM-with-object-oriented-C-code-for/m-p/389279#M10903</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2014-12-06T06:49:58Z</dc:date>
    </item>
  </channel>
</rss>

