cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO DMA FatFs USB HS slow data transfer

Oleksandr Borysov
Associate II

Posted on August 06, 2017 at 14:48

Hello, forum.

I created a simple USB Card Reader

with CubeMX 

but the speed of data transmitting is about 355 kByte/s.

I want to improve it but I don't know how.

My setup.

Board STM32f446RE. CubeMX 4.22. Package STM32Cube FW_F4 V1.16.0.

I created the project in the next steps:

1) I used CubeMX to generate the project with following modules: internal USB HS, SDIO with DMA, FarFs. Also, I increased heap and stack memory.

2) I used sd_diskio's methods in usbd_storage_if to connect SDIO to USB HS. (I use FatFs's BSP driver to provide access to SD Card memory)

3) I applied DMA fix from

Ripa.Radek.001

  

<LINK NO LONGER ACTIVE>

I tested my project in DMA and Polling mode and get next results:

Polling mode(without DMA): read/write speed

≈

355 kByte

/s, data not corrupted

DMA mode: read/write speed

≈

355 kByte

/s, data can be corrupted

Also, I tested the same project but generated with CubeMX 4.18. Package STM32Cube FW_F4 V1.14.0.

Results next:

Polling mode(without DMA): read/write speed

≈

355 kByte/s, data not corruptedDMA mode: read/write speed

≈

355 kByte

/s, data not corrupted

I attached my project, maybe someone more experienced will help me to solve this problem.

P.S. Also, I am interesting in next questions.

What maximal speed I can achieve with internal USB HS and SDIO (4 bits wide bus) with DMA?

What impact will have decryption/encryption(ST library for AES) of memory sectors during reading/writing?

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on August 06, 2017 at 15:14

MSC_MEDIA_PACKET?

https://community.st.com/0D50X00009XkeLmSAJ

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2
Posted on August 06, 2017 at 15:14

MSC_MEDIA_PACKET?

https://community.st.com/0D50X00009XkeLmSAJ

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 06, 2017 at 20:10

Thank you for the tip.

It works

perfectly for

 

FW_F4 V1.14.0.