Hello,
I’m working with an RT1176 EVK, my goal is to enable the Master LPSPI QSPI interface. The QSPI interface is connected to an FPGA. I was able to get the QSPI transmit side to successfully send packets of variable lengths to the FPGA. The FPGA properly decoded the QSPI data. However, I’m having issues on the read side.
I’m using the APP note “Using LPSPI on the KL28Z”as a reference (Document Number: AN5320) on how to configure the LPSPI QSPI.
chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.nxp.com/docs/en/application-note/AN5...
In effort to simplify things the ARM is not transmitting, only receiving. Also the FPGA is setting the D0-D3 signals high, so all of the incoming data should be 0xF.
Before entering the main loop I have the following configuration.
//set to 4 bit transfer
EXAMPLE_LPSPI_MASTER_BASEADDR->TCR = (EXAMPLE_LPSPI_MASTER_BASEADDR->TCR & ~LPSPI_TCR_WIDTH_MASK) | LPSPI_TCR_WIDTH(2);
//PCS[3:2] are configured for half-duplex 4-bit transfers
EXAMPLE_LPSPI_MASTER_BASEADDR->CFGR1 = (EXAMPLE_LPSPI_MASTER_BASEADDR->CFGR1 & ~LPSPI_CFGR1_PCSCFG_MASK) | LPSPI_CFGR1_PCSCFG(1);
//clear to enable receiving
EXAMPLE_LPSPI_MASTER_BASEADDR->TCR = (EXAMPLE_LPSPI_MASTER_BASEADDR->TCR & ~LPSPI_TCR_RXMSK_MASK);
//set to begin reading transfer
EXAMPLE_LPSPI_MASTER_BASEADDR->TCR = (EXAMPLE_LPSPI_MASTER_BASEADDR->TCR & ~LPSPI_TCR_TXMSK_MASK) | LPSPI_TCR_TXMSK(1);
In the while(1) loop, I have the following configuration and I read the RDR register, which is 32 bits.
//clear to enable receiving
EXAMPLE_LPSPI_MASTER_BASEADDR->TCR = (EXAMPLE_LPSPI_MASTER_BASEADDR->TCR & ~LPSPI_TCR_RXMSK_MASK);
//set to begin reading transfer
EXAMPLE_LPSPI_MASTER_BASEADDR->TCR = (EXAMPLE_LPSPI_MASTER_BASEADDR->TCR & ~LPSPI_TCR_TXMSK_MASK) | LPSPI_TCR_TXMSK(1);
//Frame size
EXAMPLE_LPSPI_MASTER_BASEADDR->TCR = (EXAMPLE_LPSPI_MASTER_BASEADDR->TCR & ~LPSPI_TCR_FRAMESZ_MASK) | LPSPI_TCR_FRAMESZ(7);
//Receive data
EXAMPLE_LPSPI_MASTER_BASEADDR->TCR = (EXAMPLE_LPSPI_MASTER_BASEADDR->TCR & ~LPSPI_RDR_DATA_MASK) | LPSPI_RDR_DATA(7);
PRINTF(" %08X", EXAMPLE_LPSPI_MASTER_BASEADDR->RDR);
PRINTF("\r\n Press any key to run again\r\n");
GETCHAR();
In the APP note it lists the configuration needed to enable the QSPI interface. Part of the configuration from the 4-bit sending operation section 3.3.1 is also needed for the Read operation (highlighted in yellow).



I’m probing the QSPI signals with an Oscope. I see 8 clock cycles per transaction, and 0xFF printed on the terminal, when it should be 0xFFFFFFFF. It’s as if the receive isn’t configured as QSPI, but instead as SPI.

Questions:
Does anyone have any examples of how to configure the LPSPI QSPI to read multiple bytes?
Am I missing a configuration register that I need to set/clear to get the reads to work properly?
Thanks,
Ricardo