Other Parts Discussed in Thread: OMAP-L138, OMAPL138, CDCE913
Hi,
I am using OMAP-L138 EVM and my intention is to write large amount of sampled data to SD card. I have working RTFS based MMCSD code to write data to SD card and BSL based UPP code to sample analog signal, respectively. However, when I add BSL code to RTFS based project, it compiles fine but doesn't work.
Step-wise debugging revealed that it doesn't come back from this function result = mmcsdStorageInit(), to be more precise, it gets lost in the function given below which is defined in blkmedia.c and I don't see anything.
result = EDMA3_DRV_requestChannel(gBlkmediaSyncEdmaHandle,
&gBlkmediaIoChId,
&gBlkmediaIoTcc,
edmaEventQ,
&blkmediaIoEdmaCallback,
NULL);
You can have a look on the merged code routine.
Code Snippet:
void main()
{
USTIMER_init();
I2C_init(I2C0, I2C_CLK_400K);
I2CGPIO_init(0x20);
// Setup UPP
// UPP registers setup
// Setup ADC Clock
rtfsPosixInit();
/* initialize the PSC */
mmcsdPscInit();
Psc_ModuleClkCtrl(Psc_DevId_0, CSL_PSC_CC0, TRUE);
Psc_ModuleClkCtrl(Psc_DevId_0, CSL_PSC_TC0, TRUE);
Psc_ModuleClkCtrl(Psc_DevId_0, CSL_PSC_TC1, TRUE);
Psc_ModuleClkCtrl(Psc_DevId_1, CSL_PSC_CC1, TRUE);
/* Create semaphore for card insert/remove interrupt mode */
cardDetectSem = SEM_create(0, NULL);
}
Void task(Arg id_arg)
{
Int32 result;
Int id = (Int)id_arg;
char driveId[3];
printf("MMC/SD Application Task %d Starting.\n", id);
/* Configure MMC/SD */
configureMmcsd0(mmcsdGpioInputIsr);
printf("Configured MMC/SD card.\n");
/* Initialize for MMC/SD storage device */
result = mmcsdStorageInit();
if (result == SUCCESS) {
printf("Block Driver initialization succeeded.\n");
}
else {
/* Most likely not enough memory */
printf("Block Driver initialization failed, error = %d.\n", result);
return;
}
/* verify that the MMC/SD card is present before continuing */
PollDeviceReady();
/* Get drive letter associated with MMC/SD */
result = getdriveid(BFS_DEVICE_TYPE_MMC, 0 , 0, driveId);
if (result != -1) {
printf("Get drive ID DONE. %s\n", driveId);
}
else {
printf("Error getting drive ID.\n");
return;
}
/* Clear the partition */
result = clearPartition(driveId);
if (result == SUCCESS) {
printf("Clear partition DONE.\n");
}
else {
printf("Clear partition Failed, error = %d.\n", rtfserrno);
return;
}
/* Format the drive */
result = fmtdrv(driveId);
if (result == SUCCESS) {
printf("Formatting succeeded.\n");
}
else {
printf("Formatting failed, error = %d.\n", rtfserrno);
return;
}
printf("---Collecting samples from ADC---\r\n");
UPP->UPID0 = (uint32_t)&recv_buffer;//add next DMA transfer
UPP->UPID1 = 0x00010800; //1 lines 128 bytes per line
UPP->UPID2 = 0x00000800; //no offset between lines
printf("MMCSD File Operations Starting.\n");
doFileIO(driveId);
printf("Starting rtfs shell.\n");
bfs_shell();
/* Shutdown the MMCSD storage device */
result = mmcsdStorageDeInit();
if (result == SUCCESS) {
printf("mmcsdStorageDeInit succeeded.\n");
}
else {
printf("mmcsdStorageDeInit failed, error = %d.\n", result);
}
}
I don't have much technical knowledge about OMAP-L138 and peripheral so I have no idea what's going on. I will really appreciate your help.
Thanks.
Regards,
BAS
