FlexSPI: kFLEXSPI_Command_WRITE_SDR without preceding kFLEXSPI_Command_SDR

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FlexSPI: kFLEXSPI_Command_WRITE_SDR without preceding kFLEXSPI_Command_SDR

649 次查看
stmatscaps
Contributor III

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

标记 (2)
0 项奖励
回复
3 回复数

613 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

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/api_doc/dev/1095/group__flexspi.html#gga1281e0d76a2090ffd1ec488bcd5243cca...

It will be useful!

Thanks & Regards,
Sanket Parekh

0 项奖励
回复

609 次查看
stmatscaps
Contributor III

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

0 项奖励
回复

566 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复