Skip to content

Commit 04ae22e

Browse files
ankeXiaonashif
authored andcommitted
drivers: spi: update spi_mcux_flexio.c
After testing the flexio spi_loopback on the ke1xz platform, it is found that the master transfer and receive are not synchronized. So add loop code to wait for the master transfer to complete for frdm_ke17z and frdm_ke17z512 platforms. Signed-off-by: Anke Xiao <[email protected]>
1 parent 41f9d52 commit 04ae22e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/spi/spi_mcux_flexio.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2024, STRIM, ALC
3+
* Copyright 2024 NXP
34
*
45
* SPDX-License-Identifier: Apache-2.0
56
*/
@@ -100,6 +101,11 @@ static int spi_mcux_flexio_isr(void *user_data)
100101
const struct spi_mcux_flexio_config *config = dev->config;
101102
struct spi_mcux_flexio_data *data = dev->data;
102103

104+
#if defined(CONFIG_SOC_SERIES_KE1XZ)
105+
/* Wait until data transfer complete. */
106+
WAIT_FOR((0U == (FLEXIO_SPI_GetStatusFlags(config->flexio_spi)
107+
& (uint32_t)kFLEXIO_SPI_TxBufferEmptyFlag)), 100, NULL);
108+
#endif
103109
FLEXIO_SPI_MasterTransferHandleIRQ(config->flexio_spi, &data->handle);
104110

105111
return 0;

0 commit comments

Comments
 (0)