Skip to main content
HNguy.14
Associate
August 6, 2020
Question

init SDIO eror SDIO_Init(&SDIO_InitStructure);

  • August 6, 2020
  • 2 replies
  • 698 views

i used SDIO project to read micosd card in STM32 Standard Peripheral Libraries

when i upload code and debug

__IO SD_Error errorstatus = SD_OK;

 uint32_t response = 0, count = 0, validvoltage = 0;

 uint32_t SDType = SD_STD_CAPACITY;

 /*!< Power ON Sequence -----------------------------------------------------*/

 /*!< Configure the SDIO peripheral */

 /*!< SDIO_CK = SDIOCLK / (SDIO_INIT_CLK_DIV + 2) */

 /*!< on STM32L1xx devices, SDIOCLK is fixed to 48MHz */

 /*!< SDIO_CK for initialization should not exceed 400 KHz */  

 SDIO_InitStructure.SDIO_ClockDiv = SDIO_INIT_CLK_DIV;

 SDIO_InitStructure.SDIO_ClockEdge = SDIO_ClockEdge_Rising;

 SDIO_InitStructure.SDIO_ClockBypass = SDIO_ClockBypass_Disable;

 SDIO_InitStructure.SDIO_ClockPowerSave = SDIO_ClockPowerSave_Disable;

 SDIO_InitStructure.SDIO_BusWide = SDIO_BusWide_1b;

 SDIO_InitStructure.SDIO_HardwareFlowControl = SDIO_HardwareFlowControl_Disable;

 SDIO_Init(&SDIO_InitStructure);

 /*!< Set Power State to ON */

 SDIO_SetPowerState(SDIO_PowerState_ON);

 /*!< Enable SDIO Clock */

 SDIO_ClockCmd(ENABLE);

 /*!< CMD0: GO_IDLE_STATE ---------------------------------------------------*/

 /*!< No CMD response required */

 SDIO_CmdInitStructure.SDIO_Argument = 0x0;

 SDIO_CmdInitStructure.SDIO_CmdIndex = SD_CMD_GO_IDLE_STATE;

 SDIO_CmdInitStructure.SDIO_Response = SDIO_Response_No;

 SDIO_CmdInitStructure.SDIO_Wait = SDIO_Wait_No;

 SDIO_CmdInitStructure.SDIO_CPSM = SDIO_CPSM_Enable;

 SDIO_SendCommand(&SDIO_CmdInitStructure);

--------------------

Error here SDIO_Init(&SDIO_InitStructure);

crash when debug SDIO_Init(&SDIO_InitStructure);

Please help me

This topic has been closed for replies.

2 replies

TDK
August 6, 2020

What does "crash" mean here? If it hard faults, examine the SCB registers to find out why.

"If you feel a post has answered your question, please click ""Accept as Solution""."
dbgarasiya
Senior
August 10, 2020

may be pin mismatch issue .