linux 读写sdio,使用SDIO+DMA 来读写SD卡,怎么提高写的速度?

这是我测试读写速度的程序:

[mw_shl_code=c,true]printf("Write single sector time begin ...\r\n");

couter_time = 0;

TIM_Cmd(TIM3, ENABLE);

for(i=0; i<10000; i++)

{

SDCARD_Write_Sector(read_write_buf,1000+i,1);

}

TIM_Cmd(TIM3, DISABLE);

printf("Write single sector time over ...\r\n");

printf("write single: time=%d s \r\n",couter_time);

printf("write single: speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120

printf("Read single sector time begin ...\r\n");

couter_time = 0;

TIM_Cmd(TIM3, ENABLE);

for(i=0; i<10000; i++)

{

SDCARD_Read_Sector(read_write_buf,1000+i,1);

}

TIM_Cmd(TIM3, DISABLE);

printf("Read single sector time over ...\r\n");

printf("Read single : time=%d s \r\n",couter_time);

printf("Read single : speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120

printf("Write multi sector time begin ...\r\n");

couter_time = 0;

TIM_Cmd(TIM3, ENABLE);

for(i=0; i<10000; i+=20)

{

while( SDCARD_Write_Sector(read_write_buf,20000+i,20) == 0xff){};

}

TIM_Cmd(TIM3, DISABLE);

printf("Write multi sector time over ...\r\n");

printf("write multi: time=%d s \r\n",couter_time);

printf("write multi: speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120

printf("Read multi sector time begin ...\r\n");

couter_time = 0;

TIM_Cmd(TIM3, ENABLE);

for(i=0; i<10000; i+=20)

{

while( SDCARD_Read_Sector(read_write_buf,20000+i,20) == 0xff ){};

}

TIM_Cmd(TIM3, DISABLE);

printf("Read multi sector time over ...\r\n");

printf("Read multi : time=%d s \r\n",couter_time);

printf("Read multi : speed=%d KBps \r\n",5120/couter_time);//(512 * 1000/1024)=5120[/mw_shl_code]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值