Configuring FLEXSPI with XIP to do writes using AHB operations.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Configuring FLEXSPI with XIP to do writes using AHB operations.

772 Views
rtilson
Contributor III

I would like to configure the RT1060 on the MIMXRT1060-EVK to read and write to/from QSPI with XIP enabled using the FLEXSPI. I am looking at the the flexspi_nor_polling_transfer.c example and the example uses the IPCMD for accessing and writing to the QSPI flash chip. I however would like to use the AHB feature where the processor can write to a structure that is specifically mapped to the flash memory region. What steps do I need to take to configure the FLEXSPI to accomplish this?

As expected the following code snippet doesn't work because I haven't configured the SPI LUT table wit the page write instructions.

if(configDat.config_hdr != 0xAABBCCDD)
	{
		configDat.ip_addr = 0x08675309;
		configDat.netmask = ~configDat.ip_addr;
		configDat.gateway = 0xA55FEAD7;
		printf("Hello World:%x\r\n%x\r\n%x\r\n", configDat.ip_addr,configDat.ip_addr,configDat.gateway);
	}

This is the structure I have defined to use.

typedef struct CONFIG_DATA
{
	uint32_t config_hdr;
	uint32_t nothing[2]; //nothing for 64 bytes
	uint32_t ip_addr;
	uint32_t netmask;
	uint32_t gateway;
}Config_Data;

__attribute__((section(".data_FLASH.configdata")))Config_Data configDat;

 

MEMORY
{
  /* Define each memory region */
  BOARD_FLASH (rx) : ORIGIN = 0x60000000, LENGTH = 0x7F8000 /* 8M bytes (alias Flash) */
  CONFIG_AREA (rw) : ORIGIN = 0x607F8000, LENGTH = 0x8000 /* 32,768B Configuration Area */  
  SRAM_OC (rwx) : ORIGIN = 0x20200000, LENGTH = 0xc0000 /* 768K bytes (alias RAM) */  
  SRAM_DTC (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 /* 128K bytes (alias RAM2) */  
  SRAM_ITC (rwx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128K bytes (alias RAM3) */  
}

    .data_FLASH (NOLOAD): ALIGN(4)
    {
    	FILL(0xff)
    	KEEP(*(.data_FLASH.configdata))
    } > CONFIG_AREA

And a portion of the linker script I have defined to to have my structure placed at the memory location that I want it.

 

Thank you.

Labels (1)
0 Kudos
1 Reply

756 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Sorry for the reply late.
1) What steps do I need to take to configure the FLEXSPI to accomplish this?
-- Firstly, I don't think it's available to make it, as the i.MX RT uses the AHB bus to fetch the code.
For i.MX RT1060, either IP command or ROM API can read the data from the NOR flash, you should consider one of them to do it.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

 

0 Kudos