我们有NXP RT600产品板,NORFlash USE GD25LQ40E (4Mb),QSPI接口,目前状态Norflash可以下载成功,
无法开机;请帮忙分析一下,谢谢;
配置如下:
1. NorFLASH使用FLEX Port A;
2. 四元数据
3.ISP配置
我们做了以下步骤:
1.更新FLEXSPI_SFDP驱动,
/*
* 0xC:标签
* 1:选项大小 - 1 => 2
* 0:为 SDR 命令读取 SFDP
* 0:查询期间有 1 个数据垫
* 0:闪存访问期间有 1 个数据垫
* 0:cmd_pad
* 0:quad_mode_set
ting
* 5:misc_mode
* 1:max_freq
*/
#define CONFIG_OPTION0 0xC0000201
/*
* 0x0:单个闪存连接到端口 A
*/
#define CONFIG_OPTION1 0x00000000
#define FLEXSPI_PORTA
2.修改实例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,.csHoldTime = 3,.csSetupTime = 3,.columnAddressWidth = 0,
.deviceModeCfgEnable =
0,.Csf0,Time0,
WaitModeComman = 0 .deviceModeSeq
= {. seqNum = 0,
.seqId = 0,},
.deviceModeArg = 0,
.configCmdEnable = 0,
.configModeType = {0},
.configCmdSeqs = {0},
.configCmdArgs = {0},
.controllerMiscOption = (0),
. deviceType = 1,
.sflashPadType = kSerialFlash_4
pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.lutCustomSeqEnable = 0,
.sflashA1Size = BOARD_FLASH_SIZE,
.sflashA2Size = 0,
.sflashB1Size = 0,
.sflashB2Size = 0,
.csPadSettingOverride = 0, .sclkPadSettingOverride
= 0,
.dataPadSettingOverride
= 0,
.dqsPadSettingOverride = 0,.timeoutInMscomd Inter,
.timeoutInMscomd = 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 为四模式修改新的 LUT
// 快速读取
[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),
[4*09PAD +2] = FLEXSPI_LUT_SEQ(READ_SDR,FLEXSPI_4PAD,0x04,STOP_EXE,FLEXSPI_1PAD,0x00),
//读取状态
[4*1+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05, READ_SDR, FLEXSPI_1PAD, 0x04),
//写入使能
[4*3+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06, STOP_EXE, FLEXSPI_1PAD, 0),
// 扇区擦除字节 LUT
[4*5+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20, RADDR_SDR, FLEXSPI_1PAD, 0x18),
// 块擦除 64Kbyte LUT
[4*8+0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8, RADDR_SDR, FLEXSPI_1PAD, 0x18),
//页面程序-单模
[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_EXE1PAD, FLEXSPI 0x0),
//擦除整个芯片
[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,
};