GPMCClkConfig();HWREG(0x44E00000 + 0xF4) = 0x00000002;//mmc1 clock on //PinMux Configuration //MMC1_D0~D7 pull_up mode2 HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(8)) =0x00000032; HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(9)) =0x00000032; HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(10)) =0x00000032; HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(11)) =0x00000032; HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(12)) =0x00000032; HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(13)) =0x00000032; HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(14)) =0x00000032; HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_AD(15)) =0x00000032; //MMC1_CLKno_pull mode2HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_CSN(1)) =0x0000000A; //MMC1_CMDpull_up mode2HWREG(SOC_CONTROL_REGS + CONTROL_CONF_GPMC_CSN(2)) =0x00000032; HSMMCSDBusPower(SOC_MMCHS_1_REGS, HS_MMCSD_BUS_POWER_ON);//emmc power on HSMMCSDBusVoltSet(SOC_MMCHS_1_REGS,HS_MMCSD_BUS_VOLT_3P3);//power 3.3vStatus = HSMMCSDBusFreqSet(SOC_MMCHS_1_REGS,0x1f4,0x1,0x0);//clock/500 小于400khzHSMMCSDBusWidthSet(SOC_MMCHS_1_REGS,HS_MMCSD_BUS_WIDTH_8BIT);//8 bit for (i=0; i<50000; i++);//wait for 74 more clock cycles HSMMCSDCommandSend(SOC_MMCHS_1_REGS, HS_MMCSD_CMD(MMCHS_CMD_INDX_CMD0, HS_MMCSD_CMD_TYPE_NORMAL, HS_MMCSD_NO_RESPONSE, HS_MMCSD_CM
D_DIR_READ)
,0x00000000,NULL,MMCHS_BLK_BLEN_SHIFT,0);//send CMD0 ->IDLE State Status = HSMMCSDIsCmdComplete(SOC_MMCHS_1_REGS, 0x00010000);
发送CMD0后用
HSMMCSDIsCmdComplete()去检查cmd是否完成,但是一直都没有成功,这是哪里没配置好吗?
yingsheng Yan:
发送CMD1后,使用Status = HWREG(SOC_MMCHS_1_REGS + MMCHS_STAT);语句,得到Status=0x00000040,第6位置1:0x1(R) = Card inserted