AN12255SW - Reading flash after rewrite does not show remap

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

AN12255SW - Reading flash after rewrite does not show remap

168件の閲覧回数
schafbo
Contributor III

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?

Weirdly enough, programming after the remap does seem to indicate that it took place:

Writing 2464096 bytes to address 0x60000000 in Flash
60014000 done 7% (81920 out of 1048576)
6001C000 done 10% (114688 out of 1048576)
ProgramPage (0x6001C000, 0x20009788, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc -123 (0xFFFFFF85)
60018000 done 14% (147456 out of 1048576)
ProgramPage (0x6001C000, 0x20009788, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc -123 (0xFFFFFF85)

 

Debug messages

Erasing Serial NOR on address 0x1e000...
Erasing Serial NOR on address 0x2e000...
Erase data - successfully.
Wrote to address 0x6001e000
Wrote to address 0x6002e000

Read 16 bytes from flash address 0x6001e000 ...
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,

Read 16 bytes from flash address 0x6002e000 ...
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,
Set Flash remapping start address is 0x6001e000
Set Flash remapping end address is 0x6002e000
Set Flash remapping offset is 0x10000
after enable flash remapping, re-read address 0x6001e000

Read 16 bytes from flash address 0x6001e000 ...
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,

0 件の賞賛
返信
1 返信

101件の閲覧回数
diego_charles
NXP TechSupport
NXP TechSupport

Hi @schafbo 

I am very sorry for the delayed response, I just wanted to maintain you updated. 

I ran and tested on my end, I think that I replicated your issue. Let me explain my process, could you help me with yours?

Snag_8cddd75c.png

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.

I linked i.MX RT1060-EVKB flexspi_polling_transfer (from SDK v2.16 ) to SRAM and added the below code, taken from AN12255SW flash_remap_test. 

 

	///////**** 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 < 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 < 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->GPR30 = EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE;
	IOMUXC_GPR->GPR31 = EXAMPLE_FLEXSPI_AMBA_BASE + EXAMPLE_SECTOR * SECTOR_SIZE+0x10000;
	IOMUXC_GPR->GPR32 = 0x10000;

	PRINTF("Set Flash remapping start address is 0x%x \r\n",IOMUXC_GPR->GPR30);
	PRINTF("Set Flash remapping end address is 0x%x \r\n",IOMUXC_GPR->GPR31);
	PRINTF("Set Flash remapping offset is 0x%x \r\n",IOMUXC_GPR->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 < 16; i++)
	{
		PRINTF("0x%x,",s_nor_read_buffer[i]);
	}
	PRINTF("\r\n");


 

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.

Snag_8cd2bfd2.png

 

Snag_8cd1db5d.png

After inspecting,  It turns out that flash remapping was enabled, after doing SW reset with the debugger.

When the demo starts it first erases the given flash sector, for my case it is expected to be at physical address 0x6001_4000. It expects to read 0xFFs, but an error appears. The readout from the 0x60001_4000 gets the actual contents of 0x60002_4000.

Snag_8cd99eab.png

Below the readout from debugger.

Snag_8cdd141b.png

 The 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.

Diego

 

 

 

0 件の賞賛
返信