IMXRT1050-EVK NOR Flash

cancel
Showing results for 
Search instead for 
Did you mean: 

IMXRT1050-EVK NOR Flash

576 Views
ivanucherdzhiev
Contributor I

Hello,

I am evaluating the IMXRT1050-EVK and i am trying to execute code from the onboard QSPI NOR Flash. So far i modified the hello_world_xip example , as follows:

const flexspi_nor_config_t Serialflash_config =
{
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackInternally,
.csHoldTime = 3u,
.csSetupTime = 3u,
.columnAddressWidth = 0u,
.deviceModeCfgEnable = 0,
.waitTimeCfgCommands = 0,
.deviceType = kFlexSpiDeviceType_SerialNOR,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.lutCustomSeqEnable = 0,
.sflashA1Size = 8u * 1024u * 1024u,
.dataValidTime = {16u, 16u},
.busyOffset = 1,
.busyBitPolarity = 0,
.lookupTable =
{
// Read LUTs

[4 * NOR_CMD_LUT_SEQ_IDX_READ] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x6b, RADDR_SDR, FLEXSPI_1PAD, 0x18),
[4 * NOR_CMD_LUT_SEQ_IDX_READ+1] = FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x08,READ_SDR, FLEXSPI_4PAD, 0x04),
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.blockSize = 32u * 1024u,
.ipcmdSerialClkFreq = 0,
};

And the Example booted and executed from the external NOR Flash, but now I am not able to reflash with other program. I am getting error " Accessing the memory failed ". I am using Keil IDE , because it supports the external NOR Flash.

1. Is this caused because of the flash configuration? If Yes what is the right configuration for the onboard Nor Flash?

2. Is it planed and if yes, when we can expect support from NOR FLASH in MCUXPresso studio?  

Thank you in advance.

Best regards,

Ivan Ucherdzhiev

0 Kudos
2 Replies

176 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Ivan

please take a look to the following appnote https://www.nxp.com/docs/en/application-note/AN12108.pdf 

It indicates how to reflash IMXRT.


Regards,
Carlos
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

176 Views
ivanucherdzhiev
Contributor I

Hello Carlos,

Thank you for your response. I did check this document and unfortunately it does not help. I found where is my mistake in the configuration and also how to repair the Flash memory.

.serialClkFreq = kFlexSpiSerialClk_133MHz should be no more than 66MHz because the memory is used in DTR mode.

The look up table should be as follows:

   .lookupTable =
            {
                            //0
                            //Fast read Quad IO DTR Mode Operation in SPI Mode (normal read)
                                FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xED, RADDR_DDR, FLEXSPI_4PAD, 0x18),
                FLEXSPI_LUT_SEQ(DUMMY_DDR, FLEXSPI_4PAD, 0x0C, READ_DDR, FLEXSPI_4PAD, 0x08), 
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),

 

                            //1
                            //Read Status
                                FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x1),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), 
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),

 

                            //2
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            
                            //3
                            //Write Enable
                                FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), 
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),

 

                            //4
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            
                            //5
                            //Erase Sector------------------
                                FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD7, RADDR_SDR, FLEXSPI_1PAD, 0x18),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), 
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),

 

                            //6
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            
                            //7
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            
                            //8
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            
                            //9
                            //Page Program
                                FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02, RADDR_SDR, FLEXSPI_1PAD, 0x18),
                FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x8, STOP, FLEXSPI_1PAD, 0x0), 
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),

 

                            //10
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            0x00000000,
                            
                            //11
                            //Chip Erase
                                FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xC7, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), 
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),
                FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0),

 

                            

 

                        },

To repair the Nor Flash I had to unsolder it , connect it to external Nor FLash eraser and erase the content of it.

I tried the MFGTool on several computers (Windows 10 and Windows 7) and it cannot find the IMXRT1050-evk board and I cannot erase or reflash the board from it, do you have any idea why that happens? The board which I have is revision A

Is support for Nor Flash programming planed to be added in MCUXPresso studio? Can I help with something to make that support?

Best regards,
Ivan

0 Kudos