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.

Configuring SSI0 port to be used to access SD/MMC card

Other Parts Discussed in Thread: TM4C1294NCPDT, EK-TM4C1294XL

MCU: TM4C1294NCPDT

TI-RTOS: v2.01.00.03

CCS: v6.0.1.0040

Hello,

    I successfully ran fatsdusbcopy example provided under TI-RTOS examples for Tiva C on EK-TM4C1294XL Connected LaunchPad. In this given example, the SD card is connected to the SSI2 port, but my actual hardware (that is under development) has SSI0 port assigned for SD card communications.

    I am unable to change the necessary sections of the code/drivers that will move the SD card access port from SSI2 to SSI0. Can you please point out which sections of which files need to be changed.

    I think that just by changing the following section of code won't help as the SDSPI driver will still try to access the SD card through SSI2 port.

 

/*
* ======== EK_TM4C1294XL_initSDSPI ========
*/
void EK_TM4C1294XL_initSDSPI(void)
{
/* SDSPI0 configuration */
/* Enable the peripherals used by the SD Card */
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);

/* Configure pad settings */
GPIOPadConfigSet(GPIO_PORTD_BASE,
GPIO_PIN_3 | GPIO_PIN_1,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);

GPIOPadConfigSet(GPIO_PORTD_BASE,
GPIO_PIN_0,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);

GPIOPadConfigSet(GPIO_PORTC_BASE,
GPIO_PIN_7,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);

GPIOPinConfigure(GPIO_PD3_SSI2CLK);
GPIOPinConfigure(GPIO_PD0_SSI2XDAT1);
GPIOPinConfigure(GPIO_PD1_SSI2XDAT0);

/* SDSPI1 configuration */
/* Enable the peripherals used by the SD Card */
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3);

/* Configure pad settings */
GPIOPadConfigSet(GPIO_PORTQ_BASE,
GPIO_PIN_0 | GPIO_PIN_2,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);

GPIOPadConfigSet(GPIO_PORTQ_BASE,
GPIO_PIN_3,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);

GPIOPadConfigSet(GPIO_PORTP_BASE,
GPIO_PIN_4,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);

GPIOPinConfigure(GPIO_PQ0_SSI3CLK);
GPIOPinConfigure(GPIO_PQ3_SSI3XDAT1);
GPIOPinConfigure(GPIO_PQ2_SSI3XDAT0);

/*
* These GPIOs are connected to PA2 and PA3 and need to be brought into a
* GPIO input state so they don't interfere with SPI communications.
*/
GPIOPinTypeGPIOInput(GPIO_PORTA_BASE, GPIO_PIN_2);
GPIOPinTypeGPIOInput(GPIO_PORTA_BASE, GPIO_PIN_3);

SDSPI_init();
}

Thanks

Regards

Soumyajit

  • Soumyajit,

    In addition to changing the initialization code in EK_TM4Cf1294XL_initSDSPI(), to use SSI0 instead of SSI2, with the appropriate GPIO changes, you also need to change the sdspiTivaHWattrs[] entry for the first SSI (in the same file, just above the init function).  

    If you change the definitions in the first structure in sdspiTivaHWattrs[] (for SSI2), to be appropriate for SSI0, then the driver that uses this SDSPITiva_HWAttrs structure (in ti/drivers/sdspi/SDSPPITiva) will utilize the appropriate attributes for SSI0.  

    That should do it.

    Regards,
    Scott