Micro SD card / MSP430 interface: write problem

Discussion in 'Storage' started by Christophe Braillon, Nov 7, 2009.

  1. Hi everyone,

    I have interfaced a Micro SD card to a MSP430 microcontroller using the
    SPI mode. Everything worked perfectly fine but I recently had problems
    when writing too often into my files.

    Here is my setup. As I said the card (SDHC 4Go) is directly connected to
    the microcontroller via its USCI (SPI) peripheral. I have written the
    basic SD access (register read / write, basically to find if a card is a
    SDSC or SDHC, page read / write). I have followed the reduced SD
    spécification to do so (CRC activated, waiting after any operation for
    the card to leave the 'busy' state). On top of that I have implemented a
    FAT32 filesystem driver that is able to create / delete, read / write
    any file on the root directory (not directory handling, only short
    filenames).

    Here is my problem: sometimes (I'm not able to give specific detail on
    'when' because it varies a lot in time and frequency), complete sectors
    of my create files are filled with zeroes...

    I have investigated on my filesystem implementation because it seemed
    obvious that the problem what there. But it turned out that I have
    managed to reproduce that bug only writing pages using the low level SD
    access. For exemple if i write 4000 pages of 512 bytes filled with 0xAA
    bytes, I get 2 to 10 pages filled with 0x00.

    Does anyone encountered this kind problem? I would be so grateful if
    someone could give me at least a hint on how to solve that bug because
    I'm wasting my last week investigating on that.

    Regards,

    Christophe
     
    Christophe Braillon, Nov 7, 2009
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.