This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x MMC1 Initialisation Problem

Other Parts Discussed in Thread: AM3352

Hello,


I want to use an eMMC-Chip conntected to the MMC1 Interface of the AM3352. I use my own baremetal program an doesnt have any operating system.

When I turn on the Bus power (set SD_HCTL[SDBP] = 1) and poll for it, the SDBP will never be on.
 In the TRM is mentions that If the host controller detects the No card state the bit is reset to 0.

But what causes this state or there are another reasons for the SDPB-Bit remains 0

Here is the code:

	//Pin Mux
	{
		CONTROL_MODULE_GPMC_AD0_REG.B.PAD	= 0x1; 
		CONTROL_MODULE_GPMC_AD1_REG.B.PAD	= 0x1;
		CONTROL_MODULE_GPMC_AD2_REG.B.PAD	= 0x1;  
		CONTROL_MODULE_GPMC_AD3_REG.B.PAD	= 0x1; 
		CONTROL_MODULE_GPMC_AD4_REG.B.PAD	= 0x1; 
		CONTROL_MODULE_GPMC_AD5_REG.B.PAD	= 0x1; 
		CONTROL_MODULE_GPMC_AD6_REG.B.PAD	= 0x1; 
		CONTROL_MODULE_GPMC_AD7_REG.B.PAD	= 0x1; 
		CONTROL_MODULE_GPMC_CSN1_REG.B.PAD	= 0x2;
		CONTROL_MODULE_GPMC_CSN2_REG.B.PAD	= 0x2;
	}

	//Enable Clocks
	{
		CM_PER_MMC1_CLKCTRL_REG			|= 0x2;
		CM_PER_L3_CLKCTRL_REG			|= 0x2;
		CM_PER_L4LS_CLKSTCTRL_REG		|= 0x2;
		CM_PER_CLKDIV32K_CLKCTRL_REG	|= 0x2;

		//enable clock for mmc1
		CM_PER_MMC1_CLKCTRL_REG |= 0x0;		//Enable Clock
		CM_PER_MMC1_CLKCTRL_REG |= 0x2;		//Enable Clock

		while( (CM_PER_MMC1_CLKCTRL_REG & 0x2) != 0x2 )
			asm volatile("nop");
	}

	//Soft Reset
	{
		MMC_X_SD_SYSCONFIG_REG(aMmcBase).B.SOFTRESET = 1;
		while( MMC_X_SD_SYSSTATUS_REG(aMmcBase).RESETDONE != 0x1  )
			asm volatile("nop");
	}

	//Set CAPA
	{
		MMC_X_SD_CAPA_REG(aMmcBase).B.VS18 = 1;
		MMC_X_SD_CAPA_REG(aMmcBase).B.VS30 = 1;
		MMC_X_SD_CAPA_REG(aMmcBase).B.VS33 = 1;
	}

	//Clock and Idle Config
	{
		MMC_X_SD_SYSCONFIG_REG(aMmcBase).B.AUTOIDLE			= 0x0;		//
		MMC_X_SD_SYSCONFIG_REG(aMmcBase).B.ENAWAKEUP		= 0x1;		//Enabled
		MMC_X_SD_SYSCONFIG_REG(aMmcBase).B.SIDLEMODE		= 0x1;		//???
		MMC_X_SD_SYSCONFIG_REG(aMmcBase).B.CLOCKACTIVITY	= 0x3;		//Interface and Functional Clock [On]

		MMC_X_SD_HCTL_REG(aMmcBase).B.IWE = 0x1;	//Wakepu on card Interrupt
	}

	//MMC Host Configuration
	{
		MMC_X_SD_CON_REG(aMmcBase).B.DW8	= 0x0;		//1-Bit Datatransfer
		MMC_X_SD_HCTL_REG(aMmcBase).B.DTW	= 0x0;		//1-Bit Datatransfer
		MMC_X_SD_HCTL_REG(aMmcBase).B.SDVS	= 0x5;		//Volt

		MMC_X_SD_HCTL_REG(aMmcBase).B.SDBP	= 0x1;		//Power on Host Controller
		while( MMC_X_SD_HCTL_REG(aMmcBase).B.SDBP != 0x1 )
			asm volatile("nop");
	}


 Thanks in advance

 

 

Best Regards

 

Martin