cancel
Showing results for 
Search instead for 
Did you mean: 

SD card CMD16 CRC fail

Johanan1
Associate II
Posted on April 06, 2015 at 08:55

Hello,

I am trying to use Cube generated code to SD card interface (1 bit SDIO) initialization starts ok but I always get CRC error at CMD16 at this code:

//----------------------

/*

Set block size for card if it is not equal to current block size for card */

  sdio_cmdinitstructure.Argument         = 64;

  sdio_cmdinitstructure.CmdIndex         = SD_CMD_SET_BLOCKLEN;

  sdio_cmdinitstructure.Response         = SDIO_RESPONSE_SHORT;

  sdio_cmdinitstructure.WaitForInterrupt = SDIO_WAIT_NO;

  sdio_cmdinitstructure.CPSM             = SDIO_CPSM_ENABLE;

  SDIO_SendCommand(hsd->Instance, &sdio_cmdinitstructure);

  

  /* Check for error conditions */

  errorstate = SD_CmdResp1Error(hsd, SD_CMD_SET_BLOCKLEN);

//----------------------

Can't figure out why.

Thanks

Johanan

1 REPLY 1
Johanan1
Associate II
Posted on April 06, 2015 at 11:46

Problem solved.

Ir was a hardware problem. mainly pull up resistor too high, and signal wires too long. As long as clock was 400Khz all was OK, but when clock goes to 25 Mhz, its a different story.