For FlexSPI, is it mandatory to have a kFLEXSPI_Command_SDR command before a kFLEXSPI_Command_WRITE_SDR in a LUT sequence?
I'm trying to write arbitrary data via FlexSPI without sending a fixed command code first. At the moment I'm trying to write a single byte as a test. The following LUT sequence apparently has no effect:
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x00, kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0)
When I use the following LUT sequence, I can see that command byte 0xAA followed by my data byte is sent:
FLEXSPI_LUT_SEQ(kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xAA, kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_1PAD, 0x00),
This is the code to perform the FlexSPI transfer:
flexspi_transfer_t flashXfer;
flashXfer.deviceAddress = 0;
flashXfer.port = FLASH_PORT;
flashXfer.cmdType = kFLEXSPI_Write;
flashXfer.SeqNumber = 1;
flashXfer.seqIndex = NOR_CMD_LUT_SEQ_IDX_WRITE;
flashXfer.data = data;
flashXfer.dataSize = 1;
status_t status = FLEXSPI_TransferBlocking(base, &flashXfer);
I could not find anything in the "i.MX 8M Nano Applications Processor Reference Manual" that would indicate such a restriction.
Thanks
Stephan
Hello @stmatscaps,
I hope you are doing well.
kFLEXSPI_Command_SDR -> It will transmit the Command code to Flash, using SDR mode.
kFLEXSPI_Command_WRITE_SDR -> It will transmit Programming Data to Flash, using SDR mode.
Please make sure to check the format of the lut_seq function is correct as given below.
#define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1)
Please follow "enum _flexspi_command " -> It will elaborate CMD definition of FLEXSPI, used to form LUT instruction.
One can also refer to the MCUXpresso SDK API Reference Manual in the below link.
https://mcuxpresso.nxp.com/
It will be useful!
Thanks & Regards,
Sanket Parekh
Hello Sanket,
kFLEXSPI_Command_SDR -> It will transmit the Command code to Flash, using SDR mode.
kFLEXSPI_Command_WRITE_SDR -> It will transmit Programming Data to Flash, using SDR mode.
I'm aware of the meaning of these commands. My question is whether the "kFLEXSPI_Command_SDR" must appear as first entry in a LUT sequence. This is the behavior that I'm apparently seeing, but I cannot find anything in the documentation that does spell out this restriction.
What I would like to do is to have "kFLEXSPI_Command_WRITE_SDR" as the first entry in a FlexSPI LUT sequence. This this for communication with an FPGA where we want to encode a command and data in the very first byte of an SPI transmission.
The question is whether this is possible somehow, or whether the behavior that I'm seeing is actually an undocumented restriction regarding the possible command sequences in a FlexSPI LUT.
Thanks
Stephan
Hello @stmatscaps,
I hope you are doing well.
"My question is whether the "kFLEXSPI_Command_SDR" must appear as first entry in a LUT sequence"
->Yes, It should appear first.
I hope this helps!
Thanks & Regards,
Sanket Parekh