Skip to content

Commit cccd961

Browse files
mmahadevan108kartben
authored andcommitted
drivers: nxp_flexio_spi: Fix transfer failures
This fixes failures seen with the SPI loopback test. The fix waits for the TX and RX side to be complete i.e when RX SHIFTBUF has been loaded from the RX Shifter and the TX SHIFTBUF has transferred to the TX Shifter. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 73fd29f commit cccd961

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/spi/spi_mcux_flexio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ static int spi_mcux_flexio_isr(void *user_data)
102102
const struct spi_mcux_flexio_config *config = dev->config;
103103
struct spi_mcux_flexio_data *data = dev->data;
104104

105-
#if defined(CONFIG_SOC_SERIES_KE1XZ)
106105
/* Wait until data transfer complete. */
107-
WAIT_FOR((0U == (FLEXIO_SPI_GetStatusFlags(config->flexio_spi)
108-
& (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)), 100, NULL);
109-
#endif
106+
WAIT_FOR((3U == (FLEXIO_SPI_GetStatusFlags(config->flexio_spi)
107+
& (uint32_t)(kFLEXIO_SPI_TxBufferEmptyFlag | kFLEXIO_SPI_RxBufferFullFlag))),
108+
100, NULL);
109+
110110
FLEXIO_SPI_MasterTransferHandleIRQ(config->flexio_spi, &data->handle);
111111

112112
return 0;

0 commit comments

Comments
 (0)