Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FatFs library question?

Status
Not open for further replies.

buka86

Newbie level 2
Joined
Jul 20, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
Hi,
Could somebody help me and tell me how to write data to large file using fatfs libraries.
At the beginning i'm creating always new, empty file. My next step
is to close that file. And then when I want to add some data to
that file I'm doing following things:
1. f_open(&file,"file.dat",FA_WRITE | FA_CREATE_ALWAYS);
2. f_lseek(&file,f_size(&file));
3. f_write(&file,(const void*)data_table,2048,&bw);
4. f_close(&file);

I'm using this sequence periodicaly and works fine, but sometimes happens strange things
and i've got errors from functions above. Could it be possible
that SD card doesn't work properly? These errors aren't regular,
they occur 'sometimes'. Maybe it is connected with bad sectors on SD card.

I just wanna add that I'm using Atmega128 with 8MHz internal clock.

Regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top