Two continuous LPSPI blocking transfer

Showing results for 
Search instead for 
Did you mean: 

Two continuous LPSPI blocking transfer

Contributor III

I have to read data from a serial Nor flash, connected to my RT1051 through LPSPI2.

I have to send one command byte and then I have to read 10KB data.

It would be nice to do this with two transfers:

  • a 1-byte transfer in tx for command, with the rx buffer NULL
  • another transfer with 10KB rx buffer, and NULL tx buffer

obviously the chip-select must be asserted at the first transfer and de-asserted at the end of the second transfer, between the two transfers the chip-select must remain asserted (I think the CONTC bit of TCR is to be used)

- Is it possible to do this with the SDK 2.5.0 APIs?

a single call to LPSPI_MasterTransferBlocking() would force me to allocate both rxData and txData buffers with two vectors of more than 10KB, in which the tx buffer is completely useless. Is exactly what I would like to avoid.

best regards


Labels (1)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport

Hi Massimiliano Cialdi,

     You can use the SDK 2.5.0 APIs LPSPI_MasterTransferBlocking, if you don't want to send or receive, just define the according .txData or .rxData as NULL.

    masterXfer.txData = NULL;

   masterXfer.rxData = NULL;

  About the chip-select control, if you want to control it freely, you also can configure the CS as GPIO, then use the GPIO control it freely.

You can try it on your side.

If you still have question about it, please kindly let me know.

Have a great day,


- If this post answers your question, please click the "Mark Correct" button. Thank you!


- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

0 Kudos