i have done read and write operations on fds with dummy buffer. now when im writing new data into fds it is showing the previous data .can anyone give the function to erase the fds of previous data.
i have done read and write operations on fds with dummy buffer. now when im writing new data into fds it is showing the previous data .can anyone give the function to erase the fds of previous data.
Are you using the generic FDS library? If yes then it could be the fds needs a garbage collection
fds_gc();
The fds does not automatically delete previous records you have to perform garbage collection.
yes im using generic FDS library can you explain in detail.
So actually the fds writes but does not exactly clear out the previous data and at one point unless the fds_gc() function is used it does not write new data and halts at app_error_check.
What I did was that if I got error 0x07 at app error check upon fds write, I would call the fds_gc() function. You can even check the amount of garbage collection and clear it at your will too.
so the trick is to use this function!
Hi
fds_gc (garbage collection) reclaims the flash space that is occupied by records that have been deleted, or that failed to be completely written due to, I.E., a power loss. So, in order to get rid of old records and make space for new ones, you have to first delete the records you don't want/need anymore by using fds_record_delete or fds_file_delete and then run a garbage collection with fds_gc to free them before you can write to these records again.
These commands should all be very well described in the Flash Data Storage documentation on the Infocenter, as well as in the fds example.
Best regards,
Simon
manoj97 Did it happen to solve the issue?