EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

SD/MMC Diagnostics

Started by Ram August 13, 2006
Hi,
   Im trying to write a test for SD/MMC card on power up.

   As soon as the board gets powered up - i want to test if SD/MMC card
is working fine.

  How does one go about doing it?.

  1) I am able to detect and initialise the card and read the Card
details like vendor id...

  How does one read/write into the card without a block driver/fs
support?.


 Any ideas - Suppose i want to test physical block 15 - Read/write -
What arguments need to be passed to Block R/W command?.

Any ideas?.


Please Advice,


Regards,
sriram

"Ram" <vshrirama@gmail.com> wrote in message
news:1155478326.132852.168580@p79g2000cwp.googlegroups.com...
> Hi, > Im trying to write a test for SD/MMC card on power up. > > As soon as the board gets powered up - i want to test if SD/MMC card > is working fine. > > How does one go about doing it?. > > 1) I am able to detect and initialise the card and read the Card > details like vendor id... > > How does one read/write into the card without a block driver/fs > support?. > > > Any ideas - Suppose i want to test physical block 15 - Read/write - > What arguments need to be passed to Block R/W command?.
If you've gotten this far with talking to the card, it seems you have access to at least some basic documentation. To read and write to the card, you issue the proper command, just like you did to get the capabilities block. The card probably defaults to 512 byte blocks, which is also the page size. You will need to check the appropriate bits in the capabilities block to see if your reads and writes can span pages. The safe thing is to assume that they cannot. You will need to remember that the MMC uses 24 bit addresses, and if I recall correctly, you need to calculate the absolute byte offset you wish to read--that is the parameter that you pass to the card. You then clock the card according to the datasheet, and the data is returned to you on the correct clock cycles. When talking to the device, be sure to always check the error flags. Because your user can insert or remove the device at any time, you have no guarantees that the command succeeded unless the card tells you so.

The 2024 Embedded Online Conference