Hi Victor,
I am still haven't been able to boot via FlexSPI 2 secondary pin mux and but wanted to provide some additional info.
I altered the blhost commands to tell the ivt_flashloader code to use a slower clock rate; however, even at the higher clock rate I seem to be able to erase and flash the QSPI.
I altered this command:
call "%blhost%" %blhost_connect% -j -- fill-memory 0x20202000 4 0xC1000057 word
to
call "%blhost%" %blhost_connect% -j -- fill-memory 0x20202000 4 0xC1000053 word
My Flash Configuration block at offset 0x400 is composed from this data:
const flexspi_nor_config_t qspiflash_config = {
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClksrc=kFlexSPIReadSampleClk_LoopbackInternally,
.csHoldTime = 4u,
.csSetupTime = 4u,
// Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
.controllerMiscOption = 0x110,
.deviceType = kFlexSpiDeviceType_SerialNOR,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_50MHz,
.sflashA1Size = 64u * 1024u * 1024u,
//See 30.6.2.8 table 30-24 in reference manual
//Quad Input Fast Read = 0xEB (3 byte address mode)
//Quad Input Fast Read = 0xEC (4 byte address mode)
//Following seems to be a Fast Read QSPI sequence that specifies the
// Command (CMD_SDR) 0xEc, Quad I/O Fast Read with # address bits RADDR_SDR=0x20 (4 byte)
// followed by
// MODE8_SDR of 0 to specify PAD 4X dummy cycles of 10 (wait time?) Micron sheet seems to fix this
// followed by
// Read command (READ_SDR), with Pad 4x, 4 BYTES.
// finally followed by
// Stop sequence 0, 0, 0
.lookupTable =
{
// Read LUTs
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEC, RADDR_SDR, FLEXSPI_4PAD, 0x20),
FLEXSPI_LUT_SEQ(MODE8_SDR, FLEXSPI_4PAD, 0x00, DUMMY_SDR, FLEXSPI_4PAD, 0x0A),
FLEXSPI_LUT_SEQ(READ_SDR, FLEXSPI_4PAD, 0x04, 0, 0, 0),
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.ipcmdSerialClkFreq = 0x1,
.blockSize = 256u * 1024u,
.isUniformBlockSize = true,
};
For XIP does the bootloader read the configuration data at offset 0x400 to configure the FlexSPI interface? Does the bootloader know to set internally loopback on the MCR0 register or does it default to this setting? I have noticed that when I test with the SDK nor_polling_transfer code and I don't set internal loopback on the FlexSPI interface that even when I have the serial clock at a very slow speed of 30MHz I will get bad read when accessing the region at 0x6000_0000. Is it possible the bootloader presumes a hardware configuration like the EVK board and a floating DQS line? I am setting kFlexSPIReadSampleClk_LoopbackInternally in the readSampleClkSrc field.
There is not a lot of documentation describing the controllerMiscOption field. By looking at the evt_flashloader source code I extracted that 0x100 needs to be set to have the interface use the secondary pin group (kFlexSpiMiscOffset_SecondPinMux = 8). Is this incorrect for the bootloader?
Thanks,
Brian