Skip to main content
migmel
Associate III
Jul 7, 2021 7:47 AM UTC
Question

How to transfer files from USB flash drive into SD card inserted in STM32469I Discovery board

Hello everybody,

I have set an STM32469I Discovery as USB HOST MSC which has a SD card slot available. My idea is transfer all files contained in any USB flash drive connected to the USB port into the SD card ( supposing there is enough space capacity) and include some process to measure transfer speed.

Can anyone point me in the right direction regarding the process I should follow and the libraries I should use to pull this task off ?

Thank you guys for your help. I am starting in this STM32 world and very excited about it

This topic has been closed for replies.

3 replies

migmel
migmelAuthor
Associate III
Jul 8, 2021 3:33 AM UTC

I am not sure if I should do it file by file or copying by blocks( This concept I am not sure how to convert these blocks of data back into files). Conversion from blocks to files is automatic or should I do additional process to achieve it ? or is not doable in this way ? Help please

Tesla DeLorean
Guru
Jul 8, 2021 4:01 AM UTC

Depends on how involved you want to get with file system structures.

Most straight forward would be to use FatFs, enumerate through files, do a block/cluster sized copies. Duplicating timestamps and attributes

Perhaps skipping files that already exist. ​

Presume you want to replicate directory trees and content.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
migmel
migmelAuthor
Associate III
Jul 8, 2021 6:58 AM UTC

Thank you Mr, DeLorean,

My goal is to replicate directory trees and content at the higher speed possible. Considering I am just learning, have to start with the easiest way (FatFS is easier for me to understand) and fine tune step by step. All clear but doing "a block/cluster sized copies...", well guess I have to make my own research on this.