STM32F2xx / STM32F4xx SDIO Interface Part 2 by Frank's Random Wanderings
does not help, because we cannot know the amount of data currently held in the FIFO. To deal with this, you need to keep your own “data remaining count” variable, which you can count down as you give data to the SDIO FIFO. Then when your count variable ..