Multiple Calls to HAL_SD_WriteBlocks Results in timeout error
Hello All,
I am having an issue interfacing an SD card to the STM23H7.
I am using the SDMMC1 with 4 bit wide bus. When testing HAL_SD_WriteBlocks , I can write and read from the card successfully at various lengths (different number of blocks). But I get an error when running 2 consecutive calls to HAL_SD_WriteBlocks.
status = HAL_SD_WriteBlocks(&hsd1, &datatest[0], 0, 2048/(512*2) , 1000);
status = HAL_SD_WriteBlocks(&hsd1, &datatest[0], 1, 2048/(512*2) , 1000);The 2nd call returns HAL_ERROR because SDMMC_CmdWriteMultiBlock() returned 0x4 indicating a timeout error.
I tried spin locking on HAL_SD_GetCardState() between the 2 calls. But the state is forever stuck on "TRANSFER"
Any Ideas on what I could be missing would be much appreciated,
Thanks,
Trevor
