AN12564 Clarification

cancel
Showing results for 
Search instead for 
Did you mean: 

AN12564 Clarification

Jump to solution
311 Views
chadgraham
Contributor IV

Hello,

I am having some issues adding a second QSPI device per the AN12564 app note and I'm hoping that someone can point me in the correct location.

I am working with the RT1060 dev board and I have attached a second identical QSPI device such that it is on the same bus as the existing QSPI device and the CS is connected to [P2] GPIO_SD_B1_04.  I currently have a basic program running as XIP and have configured the GPIO as part of the FlexSPI setup using the pin config tool.

Per AN12564, I have successfully added the .sflashA2Size property to the qspiflash_config structure, but I am stuck on what the next step should be.

According to the app note:

"ROM can configure FlexSPI to enable A1 and A2 according to the flash config block saved in QSPI flash(A1)"

What is this actually instructing me to do?  Thanks.

0 Kudos
1 Solution
131 Views
chadgraham
Contributor IV

Hello,

After much hardship, I was able to get this to work.  In case other people are interested, I posted a working version of the example code at FlexSPI A2 Chip Select Not Toggling.

View solution in original post

0 Kudos
5 Replies
282 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @chadgraham ,

Besides AN12564, there is an example named AN12564sw. Please download this package, you will see the whole workflow.

 

Regards,

Jing

0 Kudos
273 Views
chadgraham
Contributor IV

Hello Jingpan,

I have spent quite a bit of time in the AN12564 software, but it isn't very helpful.  The software does not contain a project that I import and walk through.  (I spend over an hour trying to modify iblinky to be the RWW, but the includes, assumptions and even multiple mains() makes this a very difficult process.) 

Would it be possible for you to generate a sample application that shows a second QSPI working?

Additionally, I need the application to operate as XIP, but AN12564 appears to only use the memory devices as user storage, not functioning/executing code.  I fear that the app note isn't ideally suited for this type of application.

Is there another app not that covers multiple QSPI XIP devices?

Finally, the part that I'm stuck on in AN12564 is the flash configuration and an updated LUT.  It seems like the LUT and general configuration should be fine since I am using the same QSPI device that is shipped on the dev board, but that I need to somehow inform the controller that it is bigger and has a second chip select.  (I think I'm close since the memory range is now reporting 00000000, but I'm unable to access or write to the memory location.)

Is there an app note or demo app that shows me how to update the controller?

0 Kudos
264 Views
chadgraham
Contributor IV

Two follow-up things.

Where can I locate detailed information on the LUT?  Specifically, is there an RT1060 or MCUXpresso document that explains the LUT and what is to go intot he LUT?

During my debugging, I noticed that the programmer is detecting 2 flash chips, but I'm not sure if it is locating two chips or simply the first one twice.  Thoughts?

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,
            // Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
            .sflashPadType = kSerialFlash_4Pads,
            .serialClkFreq = kFlexSpiSerialClk_133MHz,
            .sflashA1Size  = 8u * 1024u * 1024u,
            .sflashA2Size  = 8u * 1024u * 1024u,
            .lookupTable =
                {
                    // Read LUTs
                    FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
                    FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
                },
        },
    .pageSize           = 256u,
    .sectorSize         = 4u * 1024u,
    .blockSize          = 256u * 1024u,
    .isUniformBlockSize = false,
};

 

Inspected v.2 External Flash Device on SPI using SFDP JEDEC ID MIMXRT1060_SFDP_QSPI.cfx
Image 'iMXRT1060_SFDP_QSPI Mar 22 2021 08:15:58'
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (8MB = 128*64K at 0x60000000)
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
Inspected v.2 External Flash Device on SPI using SFDP JEDEC ID MIMXRT1060_SFDP_QSPI.cfx
Image 'iMXRT1060_SFDP_QSPI Mar 22 2021 08:15:58'
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (8MB = 128*64K at 0x60000000)
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
Connected: was_reset=false. was_stopped=true
Awaiting telnet connection to port 3330 ...
GDB nonstop mode enabled
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (8MB = 128*64K at 0x60000000)
Writing 62988 bytes to address 0x60000000 in Flash
Sectors written: 0, unchanged: 1, total: 1
Erased/Wrote sector  0-0 with 62988 bytes in 14msec
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
Flash Write Done
Flash Program Summary: 62988 bytes in 0.01 seconds (4393.69 KB/sec)

chadgraham_0-1626724306362.png

 

0 Kudos
186 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

The RWW example give you a complete LUT table. It show you how to modify LUT. After initialize, you can XIP in the second flash. If you want to skip this step, you can add erase/write command to LUT table in evkmimxrt1060_flexspi_nor_config.c.

If you want to download something to the second flash by the MCUXpresso, your setting is right. But it still need to modify code to assign code and data into flash_00.  I think the default algorithm can deal with the second flash. 

You can refer to sector 27.5.7 in reference manual for LUT.

The MCUXpresso_IDE_User_Guide.pdf in installation directory introduced how to assign code and data in a section. Please see the chapter 17.

 

Regards,

Jing

 

0 Kudos
132 Views
chadgraham
Contributor IV

Hello,

After much hardship, I was able to get this to work.  In case other people are interested, I posted a working version of the example code at FlexSPI A2 Chip Select Not Toggling.

View solution in original post

0 Kudos