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.

OMAPL138 linux写sata ssd慢

Other Parts Discussed in Thread: OMAP-L138

大家好。我们用L138,ARM侧linux写入ssd,测试速度只有不到2MB/s(100MB/64s),可能是什么原因?读取速度也慢。

系统:2.6.32,uboot 2009

ssd文件系统, fat32

每次写入16kB

int ARMOR_SaveData2Sata(const char* dataBuf)
{
int dataBytes = 0;
int retVal = ARMOR_TRUE;
pCPUinfo pInfo = getCPUinfo();
ARMOR_CFG_T * pstCfg = GetConfigGlobal();
//ARMOR_initSata(dataBuf, len);

if (pInfo->sataStartFlag == ARMOR_TRUE)
{
if (1)
{
if (pInfo->sataFrameNum == 0)
{
if(pInfo->sataFp != NULL)
{
fclose(pInfo->sataFp);
pInfo->sataFp = NULL;
}
get_time(pInfo->sataFilename);
/* Open the output file */
pInfo->sataFp = fopen(pInfo->sataFilename, "ab+");

if (pInfo->sataFp == NULL)
{
ARMOR_TRACE("Failed to open input file: %s\n", pInfo->sataFilename);
pInfo->sataStartFlag = ARMOR_FALSE;
return ARMOR_FALSE;
}
}

if (pInfo->sataFp != NULL)
{
dataBytes = fwrite(dataBuf, PCM_STORE_LEN, 1, pInfo->sataFp);
}

pInfo->sataFrameNum++;
if ((pInfo->sataFrameNum & 0x0ff ) == 0)
{
ARMOR_TRACE ("fileName:%s, dataBytes=%d, frameNum=%d\n", pInfo->sataFilename, PCM_STORE_LEN, pInfo->sataFrameNum) ;
}
if (pInfo->sataFrameNum >= pstCfg->stSata.recTime*PCM_FRAME_PER_SEC)
{
ARMOR_TRACE ("fileName:%s, dataBytes=%d, frameNum=%d last one\n", pInfo->sataFilename, PCM_STORE_LEN, pInfo->sataFrameNum) ;
//pInfo->sataStartFlag = ARMOR_FALSE;
pInfo->sataFrameNum = 0;

/* Close the input file */
fclose(pInfo->sataFp);
pInfo->sataFp = NULL;
}
}

}
else if (pInfo->sataFp != NULL)
{
pInfo->sataFrameNum = 0;
fclose(pInfo->sataFp);
pInfo->sataFp = NULL;
}
return retVal;
}