Skip to main content
December 23, 2020
Question

problem with initialisation SDMMC

  • December 23, 2020
  • 2 replies
  • 863 views
/* Send ACMD41 SD_APP_OP_COND with Argument 0x80100000 */
 
while(validvoltage == 0)
 
{
 
 if(count++ == SDMMC_MAX_VOLT_TRIAL)
 
 {
 
 return HAL_SD_ERROR_INVALID_VOLTRANGE;
 
 }
 
 
 
 /* SEND CMD55 APP_CMD with RCA as 0 */
 
 errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0);
 
 if(errorstate != HAL_SD_ERROR_NONE)
 
 {
 
 return HAL_SD_ERROR_UNSUPPORTED_FEATURE;
 
 }
 
 
 
 /* Send CMD41 */
 
 errorstate = SDMMC_CmdAppOperCommand(hsd->Instance, SDMMC_STD_CAPACITY);
 
 if(errorstate != HAL_SD_ERROR_NONE)
 
 {
 
 return HAL_SD_ERROR_UNSUPPORTED_FEATURE;
 
 }
 
 
 
 /* Get command response */
 
 response = SDMMC_GetResponse(hsd->Instance, SDMMC_RESP1);
 
 
 
 /* Get operating voltage*/
 
 validvoltage = (((response >> 31) == 1) ? 1 : 0);
 
}
 

 I tested with a debugger that where fail the program. Inside of the SD_PowerON function exist a while loop. When the cards don't recognize this while loop run infinitelly and never go out from there.

This topic has been closed for replies.

2 replies

Romain DIELEMAN
ST Employee
January 6, 2021

Hi,

This does not seem related to TouchGFX. You should add the appropriate topic tag to have more people see your post.

Could you provide more information on your setup ? Where are you doing those settings ? Are you starting from scratch or from an application template ?

/Romain

January 7, 2021

Hello.

I didn't add resistors on SD lines. I was hoping there would be enough internal pullup resistors.