In `spi_sdcard_goidle()`, insert a `busy_wait()` into the CMD55+ACMD41
loop to avoid exhausting the retry counter before the card has a chance
to be ready (required on the trellisboard, also tested OK on nexys4ddr).
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
#include <stdlib.h>
#include <time.h>
#include <string.h>
+#include <system.h>
#define USE_SPISCARD_RECLOCKING
spi_write_byte( 0xff ); spi_write_byte( 0x69 ); spi_write_byte( 0x40 ); spi_write_byte( 0x00 ); spi_write_byte( 0x00 ); spi_write_byte( 0x00 ); spi_write_byte( 0x00 );
r = spi_read_rbyte();
timeout--;
+ busy_wait(20);
} while ((r != 0x00) && (timeout>0));
if(r!=0x00) return FAILURE;