cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 SDIO, Busy state of DPSM

hate_pod
Associate
Posted on December 15, 2011 at 05:18

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.
2 REPLIES 2
infoinfo989
Associate III
Posted on December 16, 2011 at 01:49

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.

durian
Associate
Posted on January 27, 2012 at 19:17

Did you find a way of detecting the BUSY -> WAIT_S transition without polling the SD card?