cancel
Showing results for 
Search instead for 
Did you mean: 

USB host MSC example

Stephan Scherer
Associate II
Posted on January 03, 2012 at 09:29

Hi everybody,

i work with the evalboard STM3220G with the USB example from the USB host-device lib.

I try to write additional data in the create/existing file, but I'm not successful.

Can anyone say me, what i must chance to solve that problem?
11 REPLIES 11
rosarium
Associate II
Posted on January 03, 2012 at 11:20

hi stephan,

if you want to write additional data the created file, you want to take care of certain things.

in the file ''usbh_usr.c''   line no. 623,

//------------------------------------------

/* Write buffer to file */

      file_write(&file, 50, textFileBuffer);

//----------------------------------------

Here you have to change the file size from 50 to your desired value.

Also you have to add the required data inside the textFileBuffer.

Stephan Scherer
Associate II
Posted on January 03, 2012 at 11:46

Thx for your reply pila,

but maybe you understand me wrong, i don't want to write the data at once.

I want to make something like a data logging.

I have to open the existing file and add some new data.

rosarium
Associate II
Posted on January 03, 2012 at 12:19

ok..got it.

presently such option is not there in the example.

But I think it can be implemented by playing a bit with file system.

you can use the function ''file_setpos'' from file.c in EFSL.

Let me know if it helps????

Stephan Scherer
Associate II
Posted on January 03, 2012 at 12:46

I can't find either such a file nor this function....

Maybe we er talking about two different examples??

I download the USB Host and Device library (UM1021) from the ST-page.

rosarium
Associate II
Posted on January 03, 2012 at 13:20

You are dealing with USB host example or device example??

Stephan Scherer
Associate II
Posted on January 03, 2012 at 13:27

Host example for MSC

rosarium
Associate II
Posted on January 04, 2012 at 07:34

OK.. So EFSL is not there in your example. FAT_FS is there.

Lemme chk then wht options are there to append a file in FAT_FS.

There should be some in ff.c.

Stephan Scherer
Associate II
Posted on January 05, 2012 at 11:50

Thx for your hint pila,

i try to modify it, but it's my first USB-project an di'm a bit confused...

Can u give me some details??

rosarium
Associate II
Posted on January 06, 2012 at 06:15

Can u plz let me know what exactly you modified???