UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer creative1
Observer
385 Views
Registered: ‎04-05-2018

append data to a file in SDcard

hello,

I am using cora z10 to read data from XADC and stores it in SDcard, using a baremetal application. I am reading data at a rate of 1Khz from xadc and write this adc data in sdcard. I have a buffer of 1000 bytes and when its filled then i write entire buffer to SDcard. 

The problem is i am not able to append data on opened file. I am using f_write to write data and f_open in FA_WRITE mode. I don.t want to always open and close file as this operation takes around 5msec. Is there any other way to do so? How can i append data to a opened file?

Thank you.

0 Kudos
3 Replies
Scholar ericv
Scholar
361 Views
Registered: ‎04-13-2015

Re: append data to a file in SDcard

@creative1

When creating/opening the file, make sure you do it with the append qualifiers.

http://elm-chan.org/fsw/ff/doc/open.html

Regards

Eric

 

0 Kudos
Highlighted
Observer creative1
Observer
345 Views
Registered: ‎04-05-2018

Re: append data to a file in SDcard

Thank you.

i get an error 'FA_OPEN_APPEND' undeclared (first use in this function). I have included ff.h in header. I noticed that  FA_OPEN_APPEND declaration does not exist in ff.h.

Thanks.

0 Kudos
Scholar ericv
Scholar
325 Views
Registered: ‎04-13-2015

Re: append data to a file in SDcard

@creative1

You are using an older version of FatFS.

So you'll have to either do a seek after the open or upgrade FatFS.

 

 

0 Kudos