Skip to content

Commit

Permalink
driver/spi: STM32 Revert while loop on tx only
Browse files Browse the repository at this point in the history
This commit reverted while loop on tx only.
This commit solves SPI loopback failure and SPI wrong behaviour on RX.
fix:
* #35297
* #35539

Revert "drivers/spi: STM32: This solves SPI infinite loop on Tranceive"

This reverts commit 50c2acb.

Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
  • Loading branch information
affrinpinhero-2356 committed May 26, 2021
1 parent f451cd3 commit 0ccf4a3
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/spi/spi_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,8 @@ static void spi_stm32_shift_m(SPI_TypeDef *spi, struct spi_stm32_data *data)
spi_context_update_tx(&data->ctx, 2, 1);
}

if (data->ctx.rx_buf) {
while (!ll_func_rx_is_not_empty(spi)) {
/* NOP */
}
} else {
while (!ll_func_tx_is_empty(spi)) {
/* NOP */
}
while (!ll_func_rx_is_not_empty(spi)) {
/* NOP */
}

if (SPI_WORD_SIZE_GET(data->ctx.config->operation) == 8) {
Expand Down

0 comments on commit 0ccf4a3

Please sign in to comment.