<?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>MPC5xxx中的主题 Re: MPC5748G Flash Memory Remap</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866476#M12748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there's important note in the reference manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/67056i8CBC13734FD2D631/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That means you should use mirrored address like this:&lt;/P&gt;&lt;PRE&gt;PFLASH.PFCRD[0].Word0.R = 0x09200000;
PFLASH.PFCRD[0].Word1.R = 0x01000000;&lt;/PRE&gt;&lt;P&gt;Then you will see content of address 0x01000000 at address 0x09200000 (not at 0x01200000 - this remains unchanged). The rest of your initialization seems to be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 14:17:45 GMT</pubDate>
    <dc:creator>lukaszadrapa</dc:creator>
    <dc:date>2020-11-02T14:17:45Z</dc:date>
    <item>
      <title>MPC5748G Flash Memory Remap</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866475#M12747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a bootloader for DEVKIT-MPC5748G,&lt;/P&gt;&lt;P&gt;and have successfully implemented&amp;nbsp;flash memory erase and program operations,&lt;/P&gt;&lt;P&gt;as well as&amp;nbsp;starting&amp;nbsp;the application firmware.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to&amp;nbsp;utilize flash memory remap options&lt;/P&gt;&lt;P&gt;in order to be able to have two memory "slots" for application firmware.&lt;BR /&gt;That way I can&amp;nbsp;swap between them when I need to update and run new firmware.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I couldn't find any code examples for this, so I wrote it on my own&lt;/P&gt;&lt;P&gt;by looking at&amp;nbsp;the Flash Memory Controller (PFLASH) section in the MCU's reference manual.&lt;/P&gt;&lt;P&gt;However, I can't seem to get the memory remap to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to&amp;nbsp;remap 2MB of memory at logical address 0x01000000 to physical address 0x01200000.&lt;/P&gt;&lt;P&gt;I also tried it with 256KB with the same addresses, which didn't work either.&lt;/P&gt;&lt;P&gt;Here's my source code:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;// Initializes the flash remap.
static void bootFlashRemapInit()
{
    // Setup the remap logic and physical addresses,
    // per-master enable, and region size.
    PFLASH.PFCRD[0].Word0.R = 0x01200000;
    PFLASH.PFCRD[0].Word1.R = 0x01000000;
    PFLASH.PFCRD[0].Word2.R = 0xffff0015;

    // Enable remap descriptor 0.
    PFLASH.PFCRDE.R = 0xffff0000;

    // Enable instruction remap.
    PFLASH.PFCRCR.B.IRMEN = 1;
}

// Enables the flash remap.
static void bootFlashRemapEnable()
{
    PFLASH.PFCRCR.B.GRMEN = 1;
}

// Disables the flash remap.
static void bootFlashRemapDisable()
{
    PFLASH.PFCRCR.B.GRMEN = 0;
}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously, I call bootFlashRemapInit to initialize the remap, and bootFlashRemapEnable to enable it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found out in the errata for my chip mask (&lt;A class="link-titled" href="https://www.nxp.com/docs/en/errata/MPC5748G_0N78S.pdf" rel="nofollow noopener noreferrer" title="https://www.nxp.com/docs/en/errata/MPC5748G_0N78S.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/errata/MPC5748G_0N78S.pdf&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;that this chip has a known problem when trying to remap&amp;nbsp;flash memory in address range&amp;nbsp;0x00F90000-0x00FBFFFF.&lt;/P&gt;&lt;P&gt;This&amp;nbsp;is not the address range I am working with,&lt;/P&gt;&lt;P&gt;but it got me&amp;nbsp;thinking that there might be problems with the flash addresses I am working with as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody have an idea of what the problem might be?&lt;/P&gt;&lt;P&gt;Are there errors in my source code, or could the chip itself have an error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2019 15:32:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866475#M12747</guid>
      <dc:creator>aleksandar_zece</dc:creator>
      <dc:date>2019-03-18T15:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5748G Flash Memory Remap</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866476#M12748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there's important note in the reference manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/67056i8CBC13734FD2D631/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That means you should use mirrored address like this:&lt;/P&gt;&lt;PRE&gt;PFLASH.PFCRD[0].Word0.R = 0x09200000;
PFLASH.PFCRD[0].Word1.R = 0x01000000;&lt;/PRE&gt;&lt;P&gt;Then you will see content of address 0x01000000 at address 0x09200000 (not at 0x01200000 - this remains unchanged). The rest of your initialization seems to be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:17:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866476#M12748</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2020-11-02T14:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5748G Flash Memory Remap</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866477#M12749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Lukas, thank you very much for answering! I definitely overlooked this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this still didn't solve my problem. The remap is still not working, I'm simply always accessing the original location and not the remapped one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime, I made a small test program in S32 Design Studio for Power Architecture, for MPC5748G, which has two functions that blink different LEDs, and are placed at two distinct memory locations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the source code:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#include "derivative.h" /* include peripheral declarations */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define PA10 10&lt;BR /&gt;#define PA7 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern void xcptn_xmpl(void);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__attribute__ ((section(".text1"))) void blink1()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; uint32_t i;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Initialize DS4 LED.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.MSCR[PA10].B.SSS = 0;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.MSCR[PA10].B.OBE = 1;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.MSCR[PA10].B.IBE = 0;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.GPDO[PA10].B.PDO_4n = 1;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;while (1)&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;{&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;for (i = 0; i &amp;lt; 100000; i++);&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Blink DS4 LED.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.GPDO[PA10].B.PDO_4n = !SIUL2.GPDO[PA10].B.PDO_4n;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;__attribute__ ((section(".text2"))) void blink2()&lt;BR /&gt;{&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;uint32_t i;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Initialize DS5 LED.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.MSCR[PA7].B.SSS = 0;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.MSCR[PA7].B.OBE = 1;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.MSCR[PA7].B.IBE = 0;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.GPDO[PA7].B.PDO_4n = 1;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;while (1)&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;{&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;for (i = 0; i &amp;lt; 100000; i++);&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Blink DS5 LED.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;SIUL2.GPDO[PA7].B.PDO_4n = !SIUL2.GPDO[PA7].B.PDO_4n;&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Configure and enable interrupts.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;xcptn_xmpl();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Setup the remap logic and physical addresses,&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// per-master enable, and region size.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PFLASH.PFCRD[0].Word0.R = 0x09100000; // logical address&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PFLASH.PFCRD[0].Word1.R = 0x01200000; // physical address&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PFLASH.PFCRD[0].Word2.R = 0xffff0012; // 256KB region&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Enable remap descriptor 0.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PFLASH.PFCRDE.R = 0xffff0000;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Enable instruction remap.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PFLASH.PFCRCR.B.IRMEN = 1;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;// Enable flash remap.&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PFLASH.PFCRCR.B.GRMEN = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;blink1();&lt;BR /&gt; &lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;blink2(); // Won't be called but placed here so it would be included in the output file.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;while (1);&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I also added the needed program sections to the flash linker file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;MEMORY&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; flash_rchw : org = 0x00FA0000, len = 0x4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cpu0_reset_vec : org = 0x00FA0000+0x10, len = 0x4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cpu1_reset_vec : org = 0x00FA0000+0x14, len = 0x4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cpu2_reset_vec : org = 0x00FA0000+0x04, len = 0x4 &lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; m_text : org = 0x01000000, len = 256K &lt;BR /&gt;&amp;nbsp; &amp;nbsp; m_text1 : org = 0x01100000, len = 256K &lt;BR /&gt;&amp;nbsp; &amp;nbsp; m_text2 : org = 0x01200000, len = 256K &lt;BR /&gt;&amp;nbsp; &amp;nbsp; m_data : org = 0x40000000, len = 768K&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;.text1 :&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; *(.text1)&lt;BR /&gt; } &amp;gt; m_text1&lt;BR /&gt; &lt;BR /&gt; .text2 :&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; *(.text2)&lt;BR /&gt; } &amp;gt; m_text2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've checked the generated .srec file, and the functions are indeed placed at the desired locations.&lt;/P&gt;&lt;P&gt;If I've understood it correctly, this code should call the blink2 function instead of blink1, since the memory has been remapped so that logical address 0x01100000 will point to the physical address 0x01200000. It still doesn't work, and always calls the blink1 function. I've tried setting the 27th bit&amp;nbsp;(e.g. 0x09100000) in both the logical and physical addresses on&amp;nbsp;or off, but none of the combinations work. And it's not that the execution will jump to an&amp;nbsp;unprogrammed area in the flash memory, it just always accesses the original, unmapped location of 0x01100000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you see any problems in this example? Maybe something else I forgot to initialize?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2019 16:30:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866477#M12749</guid>
      <dc:creator>aleksandar_zece</dc:creator>
      <dc:date>2019-03-20T16:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5748G Flash Memory Remap</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866478#M12750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as I wrote, the remapping is visible only in mirrored flash address space. Normal address space remains unchanged after remapping. That means your code must be compiled to execute from mirrored flash address space (if it is not position independent code). And that also means you can't execute that code from normal address space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because there were more questions about this, I shared simple example here to show effect of the remapping:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-342943"&gt;https://community.nxp.com/docs/DOC-342943&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 09:51:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866478#M12750</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2019-03-21T09:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5748G Flash Memory Remap</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866479#M12751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Lukas, thank you very much, again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I&amp;nbsp;didn't answer earlier, I couldn't return to working on this problem until recently.&lt;/P&gt;&lt;P&gt;Now I've done exactly as you said, compiling the code to execute from the mirrored flash address space,&lt;/P&gt;&lt;P&gt;and it works like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help! You've saved me a lot of time and probably spared me a lot of frustration. :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2019 10:15:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/866479#M12751</guid>
      <dc:creator>aleksandar_zece</dc:creator>
      <dc:date>2019-04-22T10:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5748G Flash Memory Remap</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/1603568#M22927</link>
      <description>&lt;P&gt;May I know how&amp;nbsp;&lt;SPAN&gt;to compile&amp;nbsp;the code to execute from the mirrored flash address&amp;nbsp;&lt;/SPAN&gt;space? What does it actually mean?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 09:17:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5748G-Flash-Memory-Remap/m-p/1603568#M22927</guid>
      <dc:creator>FAISAL0323</dc:creator>
      <dc:date>2023-02-22T09:17:05Z</dc:date>
    </item>
  </channel>
</rss>

