Skip to main content
Visitor II
June 20, 2007
Question

Start of data token problem(SD Card)

  • June 20, 2007
  • 13 replies
  • 2432 views
Posted on June 20, 2007 at 17:32

Start of data token problem(SD Card)

    This topic has been closed for replies.

    13 replies

    prasobhpAuthor
    Visitor II
    May 17, 2007
    Posted on May 17, 2007 at 05:31

    hi,

    I am trying to interface an SD card with DV 710B (Embest) based on STR710FZ2 . I am using same circuitry& code provided by ST for its STR711 USB ARM DEVELOPMENT PROTOTYPE BOARD. I have success fully initialized the card in SPI mode & writing in to the card is done with out any problem .But any read operation from the card fails (including register read) since Start of frame token(0xFE) is missing. Instead of (0xFE) I am getting 0xFF,0xFC,and some other data .But I can read the data from the card using a card reader (connecting to PC).What can be the problem .please help me

    Visitor II
    May 17, 2007
    Posted on May 17, 2007 at 06:41

    getting 0xff is fine, it means the card is not ready.

    0xfc is the start multi block write response. Are you sure your commands to the SD card are correct ?

    prasobhpAuthor
    Visitor II
    May 17, 2007
    Posted on May 17, 2007 at 07:31

    hi,

    I am sending command 17 for reading from the card &command 10 for status register read, in both case I am getting the same response.Please help me

    Visitor II
    May 17, 2007
    Posted on May 17, 2007 at 07:42

    what are your settings for CPHA and CPOL ?

    prasobhpAuthor
    Visitor II
    May 18, 2007
    Posted on May 18, 2007 at 02:57

    hi

    Both CPHA &CPOL are zero,I am attaching my code with this,I have tried both command 1 &41 for initialization.

    [ This message was edited by: prasobhp on 18-05-2007 06:39 ]

    ________________

    Attachments :

    code.doc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtO5&d=%2Fa%2F0X0000000aPH%2FeMOBiMsTc8S0GOhlMrpwjsJ_mKrb5xKgWWedN4b2HJI&asPdf=false
    Visitor II
    May 18, 2007
    Posted on May 18, 2007 at 06:37

    ok I have had a look at your code and it is pretty similar to mine.

    one thing I have noticed is that you are setting the SSN as an ouput.

    GPIO_Config ( GPIO0, M25_SSN|BSPI1_MC|BSPI1_SSN, GPIO_OUT_PP );

    On my board I have the SSN pin set as an input and permanently pulled high.

    prasobhpAuthor
    Visitor II
    May 18, 2007
    Posted on May 18, 2007 at 07:48

    so are you using another GPIO pin as chip select?

    Visitor II
    May 18, 2007
    Posted on May 18, 2007 at 08:09

    Yes I am using a GPIO0.14 for CS.

    prasobhpAuthor
    Visitor II
    May 19, 2007
    Posted on May 19, 2007 at 05:25

    Hi,

    I tried that but even initialization is not done correctly .Now I am using P1.15 as chip select configuration is changed like this

    GPIO_Config ( GPIO0,BSPI1_MC|BSPI1_SSN, GPIO_OUT_PP );

    GPIO_Config ( GPIO0, M25_SSN, GPIO_IN_TRI_CMOS );

    GPIO_Config ( GPIO1,15, GPIO_AF_PP );

    please help if any change is needed.

    Visitor II
    May 21, 2007
    Posted on May 21, 2007 at 08:20

    do you use IM at all? probably easier to discuss this real time.