<?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 AN12255SW - Reading flash after rewrite does not show remap in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/AN12255SW-Reading-flash-after-rewrite-does-not-show-remap/m-p/2037809#M33366</link>
    <description>&lt;P&gt;I'm having an issue with the flash_remap_test program from AN12255SW. Once the flash is remapped by writing to GPR30,31,32, a read to the expected address doesn't show that the remap is active. Is there anything I'm missing here?&lt;/P&gt;&lt;P&gt;Weirdly enough, programming after the remap does seem to indicate that it took place:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;Writing 2464096 bytes to address 0x60000000 in Flash&lt;BR /&gt;60014000 done 7% (81920 out of 1048576)&lt;BR /&gt;6001C000 done 10% (114688 out of 1048576)&lt;BR /&gt;&lt;SPAN&gt;ProgramPage (0x6001C000, 0x20009788, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc -123 (0xFFFFFF85)&lt;BR /&gt;&lt;/SPAN&gt;60018000 done 14% (147456 out of 1048576)&lt;BR /&gt;&lt;SPAN&gt;ProgramPage (0x6001C000, 0x20009788, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc -123 (0xFFFFFF85)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Debug messages&lt;/P&gt;&lt;P&gt;Erasing Serial NOR on address 0x1e000...&lt;BR /&gt;Erasing Serial NOR on address 0x2e000...&lt;BR /&gt;Erase data - successfully.&lt;BR /&gt;Wrote to address 0x6001e000&lt;BR /&gt;Wrote to address 0x6002e000&lt;/P&gt;&lt;P&gt;Read 16 bytes from flash address 0x6001e000 ...&lt;BR /&gt;0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,&lt;/P&gt;&lt;P&gt;Read 16 bytes from flash address 0x6002e000 ...&lt;BR /&gt;0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,&lt;BR /&gt;Set Flash remapping start address is 0x6001e000&lt;BR /&gt;Set Flash remapping end address is 0x6002e000&lt;BR /&gt;Set Flash remapping offset is 0x10000&lt;BR /&gt;after enable flash remapping, re-read address 0x6001e000&lt;/P&gt;&lt;P&gt;Read 16 bytes from flash address 0x6001e000 ...&lt;BR /&gt;0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2025 16:07:24 GMT</pubDate>
    <dc:creator>schafbo</dc:creator>
    <dc:date>2025-02-04T16:07:24Z</dc:date>
    <item>
      <title>AN12255SW - Reading flash after rewrite does not show remap</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/AN12255SW-Reading-flash-after-rewrite-does-not-show-remap/m-p/2037809#M33366</link>
      <description>&lt;P&gt;I'm having an issue with the flash_remap_test program from AN12255SW. Once the flash is remapped by writing to GPR30,31,32, a read to the expected address doesn't show that the remap is active. Is there anything I'm missing here?&lt;/P&gt;&lt;P&gt;Weirdly enough, programming after the remap does seem to indicate that it took place:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;Writing 2464096 bytes to address 0x60000000 in Flash&lt;BR /&gt;60014000 done 7% (81920 out of 1048576)&lt;BR /&gt;6001C000 done 10% (114688 out of 1048576)&lt;BR /&gt;&lt;SPAN&gt;ProgramPage (0x6001C000, 0x20009788, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc -123 (0xFFFFFF85)&lt;BR /&gt;&lt;/SPAN&gt;60018000 done 14% (147456 out of 1048576)&lt;BR /&gt;&lt;SPAN&gt;ProgramPage (0x6001C000, 0x20009788, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc -123 (0xFFFFFF85)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Debug messages&lt;/P&gt;&lt;P&gt;Erasing Serial NOR on address 0x1e000...&lt;BR /&gt;Erasing Serial NOR on address 0x2e000...&lt;BR /&gt;Erase data - successfully.&lt;BR /&gt;Wrote to address 0x6001e000&lt;BR /&gt;Wrote to address 0x6002e000&lt;/P&gt;&lt;P&gt;Read 16 bytes from flash address 0x6001e000 ...&lt;BR /&gt;0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,&lt;/P&gt;&lt;P&gt;Read 16 bytes from flash address 0x6002e000 ...&lt;BR /&gt;0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,&lt;BR /&gt;Set Flash remapping start address is 0x6001e000&lt;BR /&gt;Set Flash remapping end address is 0x6002e000&lt;BR /&gt;Set Flash remapping offset is 0x10000&lt;BR /&gt;after enable flash remapping, re-read address 0x6001e000&lt;/P&gt;&lt;P&gt;Read 16 bytes from flash address 0x6001e000 ...&lt;BR /&gt;0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 16:07:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/AN12255SW-Reading-flash-after-rewrite-does-not-show-remap/m-p/2037809#M33366</guid>
      <dc:creator>schafbo</dc:creator>
      <dc:date>2025-02-04T16:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: AN12255SW - Reading flash after rewrite does not show remap</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/AN12255SW-Reading-flash-after-rewrite-does-not-show-remap/m-p/2051189#M33599</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/244267"&gt;@schafbo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am very sorry for the delayed response, I just wanted to maintain you updated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran and tested on my end, I think that I replicated your issue.&amp;nbsp;Let me explain my process, &lt;STRONG&gt;could you help me with yours?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_8cddd75c.png" style="width: 705px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325631i14FA1A8D89215BDE/image-dimensions/705x245?v=v2" width="705" height="245" role="button" title="Snag_8cddd75c.png" alt="Snag_8cddd75c.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In my case, I let the same address that the demo uses to write into a sector, which is 0x6001_4000. The target remap address is 0x6002_4000.&lt;/P&gt;
&lt;P&gt;I linked i.MX RT1060-EVKB flexspi_polling_transfer (from SDK v2.16 ) to SRAM and added the below code, taken from&amp;nbsp;AN12255SW flash_remap_test.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;	///////**** test reading 16 bytes from where we wrote earlier
	memcpy(s_nor_read_buffer, (void *)(EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE),
			sizeof(s_nor_read_buffer));
	PRINTF("\r\n");
	PRINTF("Read 16 bytes from flash address 0x%x ...\r\n",EXAMPLE_FLEXSPI_AMBA_BASE+EXAMPLE_SECTOR * SECTOR_SIZE);
	for (i = 0; i &amp;lt; 16; i++)
	{
		PRINTF("0x%x,",s_nor_read_buffer[i]);
	}
	PRINTF("\r\n");

	///////**** test reading 16 bytes from the remap address.
	PRINTF("Read 16 bytes from flash address 0x%x ...\r\n",EXAMPLE_FLEXSPI_AMBA_BASE+EXAMPLE_SECTOR * SECTOR_SIZE+0x10000);
	memcpy(s_nor_read_buffer, (void *)(EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE+0x10000),
				sizeof(s_nor_read_buffer));
	for (i = 0; i &amp;lt; 16; i++)
	{
		PRINTF("0x%x,",s_nor_read_buffer[i]);
	}
	PRINTF("\r\n");
	PRINTF("\r\n");
	PRINTF("Set Flash remapping \r\n");

	FLEXSPI_SoftwareReset(EXAMPLE_FLEXSPI);
    /// so actual remapping
	IOMUXC_GPR-&amp;gt;GPR30 = EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE;
	IOMUXC_GPR-&amp;gt;GPR31 = EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE+0x10000;
	IOMUXC_GPR-&amp;gt;GPR32 = 0x10000;

	PRINTF("Set Flash remapping start address is 0x%x \r\n",IOMUXC_GPR-&amp;gt;GPR30);
	PRINTF("Set Flash remapping end address is 0x%x \r\n",IOMUXC_GPR-&amp;gt;GPR31);
	PRINTF("Set Flash remapping offset is 0x%x \r\n",IOMUXC_GPR-&amp;gt;GPR32);

	PRINTF("after enable flash remapping, re-read address 0x%x\r\n",EXAMPLE_FLEXSPI_AMBA_BASE+EXAMPLE_SECTOR * SECTOR_SIZE);
	memcpy(s_nor_read_buffer, (void *)(EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE),
			sizeof(s_nor_read_buffer));
	PRINTF("\r\n");
	PRINTF("Read 16 bytes from flash address 0x%x ...\r\n",EXAMPLE_FLEXSPI_AMBA_BASE+EXAMPLE_SECTOR * SECTOR_SIZE);
	for (i = 0; i &amp;lt; 16; i++)
	{
		PRINTF("0x%x,",s_nor_read_buffer[i]);
	}
	PRINTF("\r\n");


&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the MCUXpresso IDE and manually linked the application to SRAM. This means that I need to debug with the IDE to softload to internal SRAM the demo. After pressing SW reset and running the demo again, I noticed that my demo failed.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_8cd2bfd2.png" style="width: 717px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325625i286D26B3CA0567B9/image-dimensions/717x86?v=v2" width="717" height="86" role="button" title="Snag_8cd2bfd2.png" alt="Snag_8cd2bfd2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_8cd1db5d.png" style="width: 631px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325624i78BED59669354ABD/image-dimensions/631x82?v=v2" width="631" height="82" role="button" title="Snag_8cd1db5d.png" alt="Snag_8cd1db5d.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After inspecting,&amp;nbsp; It turns out that flash remapping was enabled, after doing SW reset with the debugger.&lt;/P&gt;
&lt;P&gt;When the demo starts it first erases the given flash sector, for my case it is expected to be at&amp;nbsp;physical address 0x6001_4000. It expects to read&amp;nbsp;0xFFs, but an error appears. The readout from the&amp;nbsp;0x60001_4000 gets the actual contents of&amp;nbsp;0x60002_4000.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_8cd99eab.png" style="width: 663px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325629i58BC5E366276D123/image-dimensions/663x343?v=v2" width="663" height="343" role="button" title="Snag_8cd99eab.png" alt="Snag_8cd99eab.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Below the readout from debugger.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_8cdd141b.png" style="width: 750px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/325630i756B4910E6827CE9/image-dimensions/750x331?v=v2" width="750" height="331" role="button" title="Snag_8cdd141b.png" alt="Snag_8cdd141b.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; The&amp;nbsp;AN12255SW flash_remap_test SW SDK used a flexspi_polling_transfer demo from an older SDK version and it does simmilar FlexSPI configuration calls. Probably the problem is that a reset on the flexspi is required.&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;
&lt;DIV id="tinyMceEditordiego_charles_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 00:29:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/AN12255SW-Reading-flash-after-rewrite-does-not-show-remap/m-p/2051189#M33599</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2025-02-26T00:29:02Z</dc:date>
    </item>
  </channel>
</rss>

