Hi,
I try to create the file system of two SD cards for C6748 using RTFS (1.10.02.32). The sample code works on the EVM board. Then I modified the code on our own board. But I can only get one SD card works, not both. Here is the code I am using.
#define MMC_INTERNAL_INST_ID 0U
#define MMC_EXTERNAL_INST_ID 1U
void MMCSD_Init()
{
Int32 result;
/* DSP/BIOS File System initialization */
result = mmcsdStorageInit();
if (result == IOM_COMPLETED) {
printf("Block Driver initialization succeeded.\n");
}
else {
//Most likely not enough memory
printf("Block Driver initialization failed, error = %d.\n", result);
return;
}
PSP_MmcsdConfig mmcsdConfig;
mmcsdConfig.opMode = PSP_MMCSD_OPMODE_DMAINTERRUPT;
mmcsdConfig.hEdma = hEdma[0];
mmcsdConfig.eventQ = PSP_MMCSD_EDMA3_EVENTQ_0;
mmcsdConfig.hwiNumber = 12u;
mmcsdConfig.pscPwrmEnable = FALSE;/* default no power management reqd */
mmcsdConfig.pllDomain = PSP_MMCSD_PLL_DOMAIN_0;
result = PSP_mmcsdDrvInit(MMCSD_CLK_FREQ, MMC_INTERNAL_INST_ID, &mmcsdConfig);
if (IOM_COMPLETED != result)
{
//Init MMCSD fail
printf("Internal SD initialization failed, error = %d.\n", result);
//return;
}
else
printf("Internal SD initialization succeeded.\n");
m_bIntSDCardPresent = isCardPresent(MMC_INTERNAL_INST_ID);
if(m_bIntSDCardPresent)
{
// Get drive letter associated with MMC/SD
result = getdriveid(BFS_DEVICE_TYPE_MMC, 0, 0, m_InternalDriveId);
if (result != -1)
{
printf("Get Internal SD drive ID DONE. %s\n", m_InternalDriveId);
}
else
{
printf("Error getting drive ID for Internal SD.\n");
m_bIntSDCardPresent = false;
}
}
mmcsdConfig.opMode = PSP_MMCSD_OPMODE_DMAINTERRUPT;
mmcsdConfig.hEdma = hEdma[0];
mmcsdConfig.eventQ = PSP_MMCSD_EDMA3_EVENTQ_0;
mmcsdConfig.hwiNumber = 12u;
mmcsdConfig.pscPwrmEnable = FALSE;/* default no power management reqd */
mmcsdConfig.pllDomain = PSP_MMCSD_PLL_DOMAIN_0;
result = PSP_mmcsdDrvInit(MMCSD_CLK_FREQ, MMC_EXTERNAL_INST_ID, &mmcsdConfig);
if (IOM_COMPLETED != result)
{
//Init MMCSD fail
printf("External SD initialization failed, error = %d.\n", result);
}
else
printf("External SD initialization succeeded.\n");
m_bExtSDCardPresent = isCardPresent(MMC_EXTERNAL_INST_ID);
if(m_bExtSDCardPresent)
{
//Get drive letter associated with MMC/SD
result = getdriveid(BFS_DEVICE_TYPE_MMC, 0, 0, m_ExternalDriveId);
if (result != -1)
{
printf("Get External SD drive ID DONE. %s\n", m_ExternalDriveId);
}
else
{
printf("Error getting drive ID for External SD.\n");
m_bIntSDCardPresent = false;
}
}
}
It always failes on
result = getdriveid(BFS_DEVICE_TYPE_MMC, 0, 0, m_InternalDriveId);
the result = -1.
It will find the external SD using
result = getdriveid(BFS_DEVICE_TYPE_MMC, 0, 0, m_ExternalDriveId);
and assigns "A" to external SD.
If I use result = getdriveid(BFS_DEVICE_TYPE_MMC, 1, 0, m_ExternalDriveId);
Then it will fail too.
Could someone help me about how to create file system for two SD cards?
Thanks,
Yi