how can make MSC and SDMMC faster?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

how can make MSC and SDMMC faster?

ソリューションへジャンプ
1,527件の閲覧回数
joseph5760
Contributor II

I ran the usb_device_composite_cdc_msc_disk example, and saw a speed of about 5 MiB/s through the sdhc card.

 

And this picture is the speed of only USB MSC benchmarked after reading Null (zero) instead of SD card.

joseph5760_0-1637879041791.png

 

 

From this, USB can operate up to about 30 MiB/s, and SD is about 5 MiB/s.

 

But I want more speed. At least the speed of the SD card of 5 MiB/s seems to be too slow.

198MHz * 4bit => 99MiB/s is the theoretical speed, and the SD card speed measured by the PC is at least 60MiB/s.

 

Any ideas on how to do this faster?

ラベル(1)
タグ(4)
0 件の賞賛
1 解決策
1,439件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @joseph5760 ,

Please refer to the attachment. It shows how to speed up. You can make the buffer size as big as possible. If DTCM space is not enough, you can move to OCRAM.

And if you can set card operation voltage to 1.8v, this will enable UHS-I operation. It can improve the performance too.

 

Regards,

Jing

 

元の投稿で解決策を見る

0 件の賞賛
3 返答(返信)
1,509件の閲覧回数
joseph5760
Contributor II

After changing USB_DEVICE_MSC_READ_BUFF_SIZE to 512 * 26, the speed increased to 32 MiB/s. 

joseph5760_1-1637923337020.png

 

Also, if use an SD card, the speed is 10 MiB/s.

joseph5760_2-1637923409940.png

 

Although it is faster than before, I want to get about 30 MiB/s even when using an SD card. What should I do?

 

---

 

````

if (1) {
int i=0;
int j=0;
int st = xTaskGetTickCount();
int dt;
for (i=0; i<4096; i++, j+=8) {
SD_ReadBlocks(usbDeviceMscSdcard, buffer, j, 8);
}
dt = xTaskGetTickCount() - st;
PRINTF("dt: %d\n", dt);
}

```

milliseconds = 374
speed = 42.78MiB/s (4096 * 8 * 512 / 0.374)

Reading the SD card seems fast enough. Why is SD access with MSC slow?

 

card->operationVoltage: 3 (1.8v)
BOARD_SD_Pin_Config: freq=198MHz
16384 blocks & TIME = 843 ms
=> 9.48MiB/s (So slowly...)

 

 

0 件の賞賛
1,440件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @joseph5760 ,

Please refer to the attachment. It shows how to speed up. You can make the buffer size as big as possible. If DTCM space is not enough, you can move to OCRAM.

And if you can set card operation voltage to 1.8v, this will enable UHS-I operation. It can improve the performance too.

 

Regards,

Jing

 

0 件の賞賛
1,391件の閲覧回数
joseph5760
Contributor II

Thank you!

The optimize (-O2) option gave me a 25% performance improvement.

0 件の賞賛