2011-12-14 08:18 PM
After transmitting a block of data, SD Card sends the CRC for the data.
After sending CRC, SD Card sometimes puts itself in the ''Busy'' mode.According to the reference manual, STM32's SDIO peripheral's data path state machine (DPSM) also waits in the ''Busy'' state while SD Card is in ''Busy'' mode. This is how the system works. My question is this:Which interrupt flag of SDIO can be used to be sure that DPSM moves from ''Busy'' to ''WAIT_S'' state?STM32's reference manual is ambigious about this. It says that (SDIO->STA & DBCKEND) is set after a valid CRC is received from the SD during the block transfer. However, it does not explicitly associate any interrupt flag for ''WAIT_S'' state. How can I know that DPSM moves from ''Busy'' to ''Wait_S'' during multiple block data write?(I am aware of the fact that I can query SD card using CMD13 over the command line to see if it is ''Busy'' or not. If SD itself is not busy I can be sure that DPSM is not busy too. However, for some other reasons I do not want to issue a command to the SD just to learn whether or not STM32's internal state machine is busy or not. That is why I am looking for an interrupt flag.)I will greatly appreciate any help.2011-12-15 04:49 PM
Yep, you're right, that's how the system works. And that's how it has to work, for the case of multi-block transfers.
Take a look at the DATAEND bit / interrupt to tell you when your current transfer has finished, ie the count register has dropped to zero. Remember too that it might not trigger if some error occurred (eg a crc error) so make sure you also enable interrupts for the variour error bits.2012-01-27 10:17 AM
Did you find a way of detecting the BUSY -> WAIT_S transition without polling the SD card?