fx3s fatfs with USB3.0 MSC & FATFS SD Read/Write Throughput

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
asrac_1545771
Level 1
Level 1

Hi,

We are using Cypress FX3S based USB 3.0 Dongle.

This board has two SD card sockets along with a USB 3.0 Interface to Host for Mass Storage Class for both SD cards.

I am using two 32GB Samsung MicroSD cards with SD Adaptor.

CardA: 32GB Samsung Class 10 MicroSD with SD Adaptor.

CardB: 32GB Samsung EVO plus Class 10 (U1) MicroSD with SD Adaptor. (Write upto 20MB/s and Read upto 80 MB/s specified in the product).

The Application will do copy files from Card A to Card B using FatFS APIs. (using http://elm-chan.org/fsw/ff/00index_e.html module)

When I run the Application in FX3S dongle, I am seeing Seq Read Throughput Not reaching maximum

as specified in the uSD card make.

I tested in both DDR50 and SDR50 modes, in both modes I am getting below results.

When I am using card B, but getting only 25MB/s Seq read throughput. I need upto 40MB/s

When I am using card A, but getting only 20MB/s Seq read throughput. I need upto 30MB/s

I tested the same in CrystalDiskMark 6.0.2 Tool. getting the same less throughput result.

I initialized the FX3S SD's, its GPIO and run FATFS copy application.

I formatted two uSD  as FAT32 with 32KB Cluster Size.

I am using 32KB DMA buffer for FATFS read/write buffer in FX3S application.

"copy_file_simple()" function is adapted from http://elm-chan.org/fsw/ff/00index_e.html module application.

Application will do Coping FAT32 FS files from CardA to CardB.

Also I am doing Read Only Test in both uSD cards,

CardA : BENCHMARK READ SD0:(256MB BLEN=32KB): 14925 Ticks(ms) -> 18 MB/s , But (my uSD card supports)I need upto 30MB/s

CardB : BENCHMARK READ SD1:(256MB BLEN=32KB): 10811 Ticks(ms) -> 25 MB/s , But (my uSD card supports)I need upto 40MB/s

Also I need improved SD Write Maximum Speed/Throughput.

How can I get increased SD Read & Write Throughput using FATFS and USB3.0-MassStorageClass Applications.

Note : Please find the application output log attached with this.

Please find the application copy status like this below:

Copy from CardA to CardB:

===========================================

393479623 Bytes written in 40041 Ticks(ms)

Copy Time: 38913 Ticks(ms)

Read  Time(ms): 21793   Write Time(ms): 15834

Read  Speed: 17631(KB/s)        Write Speed: 24267(KB/s)

Copy Speed: 9595 KB/s

1 Files Matched

31 Files Written

Copy Files (proj) Completed!!!

===========================================

Copy from CardB to CardA:

===========================================

812910573 Bytes written in 84790 Ticks(ms)

Copy Time: 83366 Ticks(ms)

Read  Time(ms): 35304   Write Time(ms): 46140

Read  Speed: 22486(KB/s)        Write Speed: 17205(KB/s)

Copy Speed: 9362 KB/s

1 Files Matched

42 Files Written

Copy Files Completed!!!

===========================================

Regards

Ashok

0 Likes
1 Solution

It is expected that the throughput will reduce when you integrate fatfs in the device. Because this adds overhead to actual data transfer.

View solution in original post

0 Likes
4 Replies
KandlaguntaR_36
Moderator
Moderator
Moderator
25 solutions authored 10 solutions authored 5 solutions authored

Ashok,

I have done the similar test but with default Windows application as follows. It looks like this is Fatfs limitation.

The throughput also depends on the USB Mass Storagfe device driver as well.

The following setup is used to measure the speed of data transfer from PC to the SD card.

Hardware: Pactron FX3S USB RAID1 Kit

Firmware: Raid1 App Note FW AN89661

SD Card: SanDisk Extreme Pro 95 MB/s SDXC I Class 10 UHS-I card - Used single card

Tool to test the speed: Windows shows the data transfer speed as shown below.

File System Format: NTFS, exFAT and REFS - Same result with all three.

  1. Windows 10 Platform:
    1. 1. USB 2.0 Connection:

Hard Disk to SD card Write Speed = 30.1 MB/s   (shown this in the below picture)

              SD Card to Hard Disk Read Speed =  24.1 MB/s                                                                                                                                                                             

pastedImage_0.png

1. 2.  USB 3.0 connection

Hard Disk to SD card Write Speed = 37.6 MB/s    (shown this in the below picture)

SD Card to Hard Disk Read Speed =  38.1 MB/s

pastedImage_23.png

2. Windows 7 Platform:

     2.2 USB 2.0 connection:

Hard Disk to SD card Write Speed = 20.9 MB/s    (shown this in the below picture)

SD Card to Hard Disk Read Speed =  21.6 MB/s

pastedImage_20.png

     2.2 USB 3.0 connection:

Hard Disk to SD card Write Speed = 31.4 MB/s    (shown this in the below picture)

SD Card to Hard Disk Read Speed =  32.0 MB/s

pastedImage_30.png

0 Likes

Ashok,

Can you please confirm your firmware intergrates Fatfs file system like fatfs example in the SDK: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\storage_examples\cyfx3s_fatfs?

Regards,

Sridhar

0 Likes

Yes, my fx3s application integrated with fatfs filesystem module R0.13c

from elm-chan.org. I am using fatfs API to read and write files from sd0 to

sd1.

Regards

Ashok

On Thu 4 Jul, 2019, 5:11 PM KandlaguntaR_36, <community-manager@cypress.com>

0 Likes

It is expected that the throughput will reduce when you integrate fatfs in the device. Because this adds overhead to actual data transfer.

0 Likes