cancel
Showing results for 
Search instead for 
Did you mean: 

STM32h7 SDIO-SDMMC stucked

Prashki
Visitor

Hi all,

I config the SDIO & FATFS by cubeMx for my STM32H743VITx mcu. 

When I config the SDIO to SDMMC_BUS_WIDE_1B, i can see  MX_SDMMC1_MMC_Init();  initializing a card(after init i have ErrorCode 0x00000001, which is /*!< Command response received (but CRC check failed) 

but after that it doesnt accept any commands father, i cant see any reaction for example:

HAL_MMC_WriteBlocks(&hmmc1,data,0,1,100); - it doesnt even try to send , ErrorCode 0x00000004, which is timeout errror SDMMC_CmdWriteSingleBlock(SDMMC_TypeDef *SDMMCx, uint32_t WriteAdd) - i cant see it in analyzer, but programm isnt stucked i can turn off and on clock by   __HAL_RCC_SDMMC1_CLK_DISABLE();
__HAL_RCC_SDMMC1_CLK_ENABLE();  

Mmc board which connected to stm32h743 is working fine with software sdio and commercial programmers

Please guide me how to just init mmc and write 1 sector?

MMC_HandleTypeDef hmmc1;

uint8_t data[512];
data[0]=0x55;

MX_SDMMC1_MMC_Init();

HAL_MMC_WriteBlocks(&hmmc1,data,0,1,100);   // no reaction

 

static void MX_SDMMC1_MMC_Init(void)
{

/* USER CODE BEGIN SDMMC1_Init 0 */

/* USER CODE END SDMMC1_Init 0 */

/* USER CODE BEGIN SDMMC1_Init 1 */

/* USER CODE END SDMMC1_Init 1 */
hmmc1.Instance = SDMMC1;
hmmc1.Init.ClockEdge = SDMMC_CLOCK_EDGE_FALLING;
hmmc1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
hmmc1.Init.BusWide = SDMMC_BUS_WIDE_1B;
hmmc1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
hmmc1.Init.ClockDiv = 0;

result = HAL_MMC_Init(&hmmc1);
// __NOP(); // Add a breakpoint here, check result value

// if (result != HAL_OK)
// {
// Error_Handler();
// }
// if (HAL_MMC_Init(&hmmc1) != HAL_OK)
// {
// Error_Handler();
// }
/* USER CODE BEGIN SDMMC1_Init 2 */

/* USER CODE END SDMMC1_Init 2 */

}

 

0 REPLIES 0