Other Parts Discussed in Thread: EK-TM4C123GXL, SYSBIOS
Hello,
I am having a problem initializing the SDSPI driver on the TI launchpad EK-TM4C123GXL that has been modified to connect a microSD card to SSI1 on GPIO port D (pins 0-3). When I call the SDSPI open function I get the following error output in BIOS->scan for errors: (note that the function does not complete and return a NULL handle; this occurs when the function is called.)
ti.sysbios.family.arm.m3.Hwi An exception has occurred!
ti.sysbios.knl.Task Error scanning raw view to get current task.
ti.sysbios.gates.GateMutex Caught exception in view init code: InternalError: XDC runtime error: ti.sysbios.knl.Task.BasicView#14/fxn: index out of range (0)
My initialization looks like this:
Board configuration header file:
typedef enum VL01_SDSPIName
{
VL01_SDSPI0 = 0,
VL01_SDSPICOUNT
} VL01_SDSPIName;
Board configuration source file:
SDSPITiva_Object sdspiTivaObjects[VL01_SDSPICOUNT];
const SDSPITiva_HWAttrs sdspiTivaHWattrs[VL01_SDSPICOUNT] = {
{
SSI1_BASE, /* SPI base address */
GPIO_PORTD_BASE, /* SPI SCK PORT */
GPIO_PIN_0, /* SCK PIN */
GPIO_PORTD_BASE, /* SPI MISO PORT*/
GPIO_PIN_2, /* MISO PIN */
GPIO_PORTD_BASE, /* SPI MOSI PORT */
GPIO_PIN_3, /* MOSI PIN */
GPIO_PORTD_BASE, /* GPIO CS PORT */
GPIO_PIN_1, /* CS PIN */
}
};
const SDSPI_Config SDSPI_config[] = {
{&SDSPITiva_fxnTable, &sdspiTivaObjects[0], &sdspiTivaHWattrs[0]},
{NULL, NULL, NULL}
};
void VL01_initSDSPI(void)
{
/* Enable the peripherals used by the SD Card */
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI1);
/* Configure pad settings */
GPIOPadConfigSet(GPIO_PORTD_BASE,
GPIO_PIN_0 | GPIO_PIN_3,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
GPIOPadConfigSet(GPIO_PORTD_BASE,
GPIO_PIN_2,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);
GPIOPadConfigSet(GPIO_PORTD_BASE,
GPIO_PIN_1,
GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);
GPIOPinConfigure(GPIO_PD0_SSI1CLK);
GPIOPinConfigure(GPIO_PD1_SSI1FSS);
GPIOPinConfigure(GPIO_PD2_SSI1RX);
GPIOPinConfigure(GPIO_PD3_SSI1TX);
SDSPI_init();
}
SDSPI Task:
void LOG_vLOGTask(UArg arg0, UArg arg1)
{
SDSPI_Handle hSDSPIHandle;
SDSPI_Params SDSPIParameters;
uint32_t u32FatFSDriveNumber = 1;
SDSPI_Params_init(&SDSPIParameters);
hSDSPIHandle = SDSPI_open(VL01_SDSPI0, u32FatFSDriveNumber, &SDSPIParameters);
if(hSDSPIHandle == NULL)
{
System_abort("SDSPI INIT FAIL");
}
FIL file;
FRESULT result = 0;
result = f_open(&file, "1:jttest.txt", FA_WRITE);
while(1) //Task loops forever
{
Task_sleep(1000);
}
}
I am calling the VL01_initSDSPI function before starting sysbios. Stack size for the task is 1024 bytes.
The project is being built with IAR EWARM. I have been investigating how to turn on the specific diagnostics for the SDSPI module but I have been unable to locate the proper .cfg to use to enable diags_USER1 or diags_USER2 for only the SDSPI driver. Any help or insight into the issue would be greatly appreciated.
Thanks,
Jonathan

