Hello,
We are currently using XIP from external flash in OPI mode, and need to write to the configuration register of the external flash controller before XIP starts.
I'm looking at the flexspi_mem_config_t struct on how to perform device configuration. Currently we are using deviceModeSeq to configure the flash controller in OPI mode, so I cannot use that field to configure the configuration register.
However, I noticed that you can seemingly configure additional configuration sequences under the configCmdSeqs field. Am I correct in that? The documentation is lacking on this specific field, however, I've set it to the following:
.configCmdEnable = 1,
.configModeType = {
[0] = kDeviceConfigCmdType_Generic,
},
.configCmdSeqs = {
[0] = {
.seqNum = 1,
.seqId = 10, // See Lookup table for more details
.reserved = 0,
},
},
.configCmdArgs = {
[0] = (0x00 << 0) | (0x2 << 8),
},
and the LUT table is populated with the following command at index 10:
.lookupTable = {
// Other commands omitted
[4 * 10 + 0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x01, WRITE_SDR, FLEXSPI_1PAD, 0x02),
},
But it seems like this doesn't work.
Do I need to execute a write enable command in the sequence table before executing the config command sequence?
Hi,
You are correct, configCmdSeqs is the Sequence info for Device Configuration command. Write enable command is not needed, the ROM does that for you.
Best regards,
Felipe
Hi Felipe,
Thanks, good to know!
In which order is deviceModeSeq and configCmdSeqs? deviceModeSeq first, then configCmdSeqs, or vice versa?
From probing the SPI bus of a RT1176 it looks like deviceModeSeq is sent first
Hi,
I am not sure if I am understanding correctly. You can check the flash configuration block in the RM to see the appropriate offset. ROM will save all LUT items provided by user and then load it into LUT registers.
Best regards,
Felipe