disk_initialize() in FatFs library (ff.c/diskio.c) timing out
I am trying to do disk i/o with a FAT32-formatted SD card (32GB ADATA) using SPI on a STM32H742VIT6.
The disk_initialize() function in diskio.c does not complete because it looks like the wait_ready() function is always timing out.
static int wait_ready(DWORD timeout_ms)
{
BYTE d;
Timer2 = timeout_ms;
do {
d = xchg_spi(0xFF);
/* This loop takes a time. Insert rot_rdq() here for multitask envilonment. */
} while (d != 0xFF && Timer2); /* Wait for card goes ready or timeout */
return (d == 0xFF) ? 1 : 0;
}I probed the SPI signals and see that MISO (output from SD card) is always 0x00 during this while loop.
Can anyone give me an idea what I should try?
Thanks,
-Brian
