Hello,
We have NXP RT600 product board, NORFlash USE GD25LQ40E (4Mb), QSPI Interface, Currently status Norflash can download success, can not boot up; Please help analyze,Thanks;
The configuration is as follows:
1. NorFLASH Use FLEX Port A;
2. QUAD DATA
3. ISP Config
We did the following steps:
1. Update FLEXSPI_SFDP Driver,
/*
* 0xC : tag
* 1 : Option size - 1 => 2
* 0 : Read SFDP for SDR commands
* 0 : 1 data pad during query
* 0 : 1 data pad during flash access
* 0 : cmd_pad
* 0 : quad_mode_setting
* 5 : misc_mode
* 1 : max_freq
*/
#define CONFIG_OPTION0 0xC0000201
/*
* 0x0 : Single Flash connected to Port A
*/
#define CONFIG_OPTION1 0x00000000
#define FLEXSPI_PORTA
2. modify example flash_config.c
const flexspi_nor_config_t flexspi_config = {
.memConfig =
{
.tag = FLASH_CONFIG_BLOCK_TAG,
.version = FLASH_CONFIG_BLOCK_VERSION,
.readSampleClksrc=kFlexSPIReadSampleClk_LoopbackInternally,
.csHoldTime = 3,
.csSetupTime = 3,
.columnAddressWidth = 0,
.deviceModeCfgEnable = 0,
.deviceModeType = 0,
.waitTimeCfgCommands = 0,
.deviceModeSeq = {.seqNum = 0,
.seqId = 0,},
.deviceModeArg = 0,
.configCmdEnable = 0,
.configModeType = {0},
.configCmdSeqs = {0},
.configCmdArgs = {0},
.controllerMiscOption = (0),
.deviceType = 1,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.lutCustomSeqEnable = 0,
.sflashA1Size = BOARD_FLASH_SIZE,
.sflashA2Size = 0,
.sflashB1Size = 0,
.sflashB2Size = 0,
.csPadSettingOverride = 0,
.sclkPadSettingOverride = 0,
.dataPadSettingOverride = 0,
.dqsPadSettingOverride = 0,
.timeoutInMs = 0,
.commandInterval = 0,
.busyOffset = 0,
.busyBitPolarity = 0,
.lookupTable =
{
#if 0
[0] = 0x08180403,
[1] = 0x00002404,
[4] = 0x24040405,
[12] = 0x00000604,
[20] = 0x081804D8,
[36] = 0x08180402,
[37] = 0x00002080,
[44] = 0x00000460,
#endif
//kerry modify the new LUT for quad mode
// Fast Read
[4*0+0] = FLEXSPI_LUT_SEQ(CMD_SDR , FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
[4*0+1] = FLEXSPI_LUT_SEQ(MODE4_SDR, FLEXSPI_4PAD, 0x00, DUMMY_SDR , FLEXSPI_4PAD, 0x09),
[4*0+2] = FLEXSPI_LUT_SEQ(READ_SDR , FLEXSPI_4PAD, 0x04, STOP_EXE , FLEXSPI_1PAD, 0x00),
//read status
[4*1+0] = FLEXSPI_LUT_SEQ(CMD_SDR , FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x04),
//write Enable
[4*3+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP_EXE, FLEXSPI_1PAD, 0),
// Sector Erase byte LUTs
[4*5+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20, RADDR_SDR, FLEXSPI_1PAD, 0x18),
// Block Erase 64Kbyte LUTs
[4*8+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8, RADDR_SDR, FLEXSPI_1PAD, 0x18),
//Page Program - single mode
[4*9+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02, RADDR_SDR, FLEXSPI_1PAD, 0x18),
[4*9+1] = FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04, STOP_EXE, FLEXSPI_1PAD, 0x0),
//Erase whole chip
[4*11+0]= FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60, STOP_EXE, FLEXSPI_1PAD, 0),
},
},
.pageSize = 0x100,
.sectorSize = 0x1000,
.ipcmdSerialClkFreq = 1,
.isUniformBlockSize = 0,
.blockSize = 0x10000,
};
Hi @QinMaoxi ,
GD25LQ40 support JEDEC 216B. FlexSPI_A_QSPI_SFDP.cfx should support it. But you have make your own algorithm. How do you know it download success?
You can switch the board to isp mode. Then use Security Provisioning too to connect the flash.
If connect success, the ROMboot will configure QE bit for you. That is important.
Then you can use Tools->Flash programmer to read out what you've programmed in the flash and check if it is correct. If it's correct, that means your algorithm is correct.
Click Conver to FCV button, it can generate FCB binary file. You can compare the binary file with your flexspi_config structure.
RT685_AUD EVK use qspi too. Your project can base on its SDK.
Regards,
Jing