How to use configCmdArgs in flexspi_mem_config_t

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to use configCmdArgs in flexspi_mem_config_t

1,145件の閲覧回数
espp
Contributor I

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?

0 件の賞賛
4 返答(返信)

1,112件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

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

1,101件の閲覧回数
espp
Contributor I

Hi Felipe,

Thanks, good to know!

In which order is deviceModeSeq and configCmdSeqs? deviceModeSeq first, then configCmdSeqs, or vice versa?

0 件の賞賛

990件の閲覧回数
samrg123
Contributor I

From probing the SPI bus of a RT1176 it looks like deviceModeSeq is sent first

0 件の賞賛

1,079件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

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

0 件の賞賛