所用平台:官方LCDKC6748
主频:300MHz
SDIO_CLK频率:25MHz(用示波器测量过)
例程模板:C:\ti\pdk_omapl138_1_0_6\packages\ti\drv\mmcsd\example\fatfs_console
TF卡:Kingston Class 4 8GB
功能:实现了文件的正常读写。
测试MMCSD写卡速度的代码:
#define BUF_SIZE (72ul<<10) unsigned char test_Buf[BUF_SIZE]; static void fill_buf(unsigned char *buf) { unsigned int i; for(i=0; i<BUF_SIZE; i++) { *buf++ = i; } } void SD_wr_speed_test(void) { FRESULT res; UInt i; unsigned int bytes_writed; res = f_open(&rec_file, "rec_ch1.txt", FA_CREATE_ALWAYS | FA_WRITE); if(FR_OK != res) { return; } fill_buf(test_Buf); i= 1024; while(i--) { f_write(&rec_file, test_Buf, BUF_SIZE, &bytes_writed); // BUF_SIZE=72KB f_sync(&rec_file); } rec_wav_file_close(&rec_file); }
文件写入正确,文件大小72MB,耗时约106秒。写入速度约695KB每秒。