diff --git a/litex/soc/software/liblitesdcard/spisdcard.c b/litex/soc/software/liblitesdcard/spisdcard.c index 2116d50a7..f04e5b2df 100644 --- a/litex/soc/software/liblitesdcard/spisdcard.c +++ b/litex/soc/software/liblitesdcard/spisdcard.c @@ -284,7 +284,7 @@ DRESULT disk_read(BYTE drv, BYTE *buf, LBA_t block, UINT count) { cmd = CMD18; /* READ_MULTIPLE_BLOCK */ else cmd = CMD17; /* READ_SINGLE_BLOCK */ - if (spisdcardsend_cmd(cmd, sector) == 0) { + if (spisdcardsend_cmd(cmd, block) == 0) { while(count > 0) { if (spisdcardreceive_block(buf) == 0) break;