Access flash larger than 128Mb

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

Access flash larger than 128Mb

Jump to solution
1,575 Views
bing_wen
Contributor I

I am using i.mx rt1050 and flash chip MX25U25643G.  It is a 256Mb = 32 Mbyte chip so requires 4 address bytes.

The following look up table kind of works:

const flexspi_nor_config_t qspiflash_config = {
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClksrc=kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.csHoldTime = 3u,
.csSetupTime = 3u,
.sflashPadType = kSerialFlash_4Pads,
 .serialClkFreq = kFlexSpiSerialClk_100MHz,
.sflashA1Size = 32u * 1024u * 1024u,
.lookupTable =
{
// Read LUTs
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
FLEXSPI_LUT_SEQ(MODE8_SDR, FLEXSPI_4PAD, 0xF0, DUMMY_SDR, FLEXSPI_4PAD, 0x04),
FLEXSPI_LUT_SEQ(READ_SDR, FLEXSPI_4PAD, 0x04, STOP,FLEXSPI_1PAD,0 ),
},

.pageSize = 256u,
.sectorSize = 4u * 1024u,
.blockSize = 256u * 1024u,
.isUniformBlockSize = true,
};

But it does have a problem that given 3 address bytes, it can only access 16Mbytes of the flash.

According to the data sheet of the flash chip, all I need to do is to change the "4READ" (EB) command to "4READ4B" (EC) and change the address bits from 24 (0x18) to 32 (0x20). But the following setting won't boot.

 

const flexspi_nor_config_t qspiflash_config = {
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClksrc=kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.csHoldTime = 3u,
.csSetupTime = 3u,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_100MHz,
.sflashA1Size = 32u * 1024u * 1024u,
.lookupTable =
{
// Read LUTs

FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEC, RADDR_SDR, FLEXSPI_4PAD, 0x20),
FLEXSPI_LUT_SEQ(MODE8_SDR, FLEXSPI_4PAD, 0xF0, DUMMY_SDR, FLEXSPI_4PAD, 0x04),
FLEXSPI_LUT_SEQ(READ_SDR, FLEXSPI_4PAD, 0x04, STOP,FLEXSPI_1PAD,0 ),
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.blockSize = 256u * 1024u,
.isUniformBlockSize = true,
};

 

 

Is there anything else I need to do to make it work?  

 

Thanks.

0 Kudos
1 Solution
1,565 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
So far, I've not figured out the issue, however, I guess it's related to the number of dummy clock cycles, so I'd like to suggest you modify the flexspi_nor_polling_transfer demo that resides in the SDK library to build communication with the MX25U25643G, then to find appropriate dummy clock cycles.
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.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
1,566 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
So far, I've not figured out the issue, however, I guess it's related to the number of dummy clock cycles, so I'd like to suggest you modify the flexspi_nor_polling_transfer demo that resides in the SDK library to build communication with the MX25U25643G, then to find appropriate dummy clock cycles.
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
1,554 Views
bing_wen
Contributor I

Jeremy,

I've tried several dummy cycle settings with no luck. I also tried to read out JEDEC tables using the flash load program. The returned values are attached. 

I noticed that "has_4b_addressing_inst_table" is false, and the table is empty. 

The flash datasheet also mentioned another way to get 4-byte addressing by issuing "EN4B" command. The question is where should I put it in the LUT so that the flexspi can execute it?  Can it be done by the boot rom?

 

Thanks, 

BIng

0 Kudos
1,543 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
After digging deeper, it needs to set 4 BYTE bit to enable 32-bit address mode.

jeremyzhou_0-1644396267884.png

In my opinion, it'd better use the 24-bit address mode if the image's size doesn't exceed 16 MB, and you can use the FlexSPI driver to enable 32-bit address mode, and in the application code, it's available to use the 4READ4B command to access the upper 16 MB part of MX25U25643G, in another word, the upper 16 MB part of MX25U25643G seems like to be a 'sperate' data flash to store some data.

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