2012-11-12 06:16 AM
Hello, I use STM3210C-EVAL board.
I have to copy the files from the SD card to a USB wih the format FAT. Is there someone who can help me? Thanks in advance. #stm3210c-eval #fatfs #sdcard-fatfs #f_mount-sdcard #syncobj.c-windows.h2012-11-12 07:10 AM
Is there someone who can help me?
I believe that ST maintains a list of consultants/contractors you can hire.2012-11-12 08:57 AM
If you have already made a code that makes this function, thank you for advise me.
2012-11-12 09:15 AM
You should perhaps dig through the source of the examples, and libraries for the STM32 chips and boards. Amongst the available code are examples of the various aspects you are looking for, ie USB MSC Host, SDIO, FatFs, etc.
I have some of these functions on other boards, but don't have this specific board, or a plan to port it.2012-11-13 12:10 AM
Hello,
In fact, I have already started to work on this project. I have compiled the STM32_USB_Device_Library with USB mass storage device example. The Mass storage example uses the microSD Flash embedded in the STM3210C-EVAL evaluation board as media for data storage. up to now, I managed to read SD card , and write on the SD card (FATFS). But my aim is to copy the data from the SD card to a USB key (I do not still have this function code), so I have to compile USB HOST Library. that's why I find it complicated a bit... how I can use both libraries at the same time! In addition I do not see how I use the FatFS commands, for example: f_mount(0,&fatfs) it will be for the USB or the SD card! best regards2012-11-13 07:40 AM
The first parameter for f_mount() is a drive number, you'd need to implement support for two drives, and map your IO functions to the appropriate device.
2012-11-21 05:47 AM
Hi Clive1,
Can you please explain to me, what is the role of the ''syncobj.c'' file ? thnx :)2012-11-21 09:39 AM
Can you please explain to me, what is the role of the ''syncobj.c'' file ?
In an RTOS environment it allows you to implement thread synchronization, or otherwise serialize access to the device/file-system. It would be required if you are likely to cause re-entrant behaviour into FatFs, ie run one access in the foreground, and other(s) in the background. Unchecked re-entrant behaviour is likely to cause file-system corruption, and as such is quite undesirable.2012-11-22 08:47 AM
I have a problem with the function f_mount(BYTE vol, FATFS *fs) .
In fact, when I compile the Host library for writing and reading on a USB stick, I use this function f_mount(0 , &fatfs). Similarly, when I compile the Device Library for writing and reading on the SD card, I also use this function f_mount(0 , &fatfs)!!!! How does the program know which drive I will write if I use the same fuction with the same parameters ?!! for example if I put f_mount(1 , &fatfs)... What is going to happen?2012-11-22 09:03 AM
As clive1 has already said, ''The first parameter for f_mount() is a drive number, you'd need to implement support for two drives, and map your IO functions to the appropriate device''
The documentation for f_mount() is here:
Home page for FatFs - includes documentation, links to examples, forum, etc: