From a56a178768fc758d4de28d132c9a29013978ab38 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 6 Feb 2023 13:09:45 +0100 Subject: [PATCH] software/liblitesdcard: Add missing SPI_DONE mask on read status. --- litex/soc/software/liblitesdcard/spisdcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/liblitesdcard/spisdcard.c b/litex/soc/software/liblitesdcard/spisdcard.c index da1b17937..44cf231ea 100644 --- a/litex/soc/software/liblitesdcard/spisdcard.c +++ b/litex/soc/software/liblitesdcard/spisdcard.c @@ -64,7 +64,7 @@ static uint8_t spi_xfer(uint8_t byte) { /* Initiate SPI Xfer */ spisdcard_control_write(8*SPI_LENGTH | SPI_START); /* Wait SPI Xfer to be done */ - while(spisdcard_status_read() != SPI_DONE); + while((spisdcard_status_read() & SPI_DONE) != SPI_DONE); /* Read MISO and return it */ return spisdcard_miso_read(); }