Hi, I use SDK13.1 FDS example and have some questions about that. Is there any influence about the lifetime of Flash when i use FDS function to write and delete the records.If it has,how to calculate the lifetime of Flash.Thanks.
Hi, I use SDK13.1 FDS example and have some questions about that. Is there any influence about the lifetime of Flash when i use FDS function to write and delete the records.If it has,how to calculate the lifetime of Flash.Thanks.
thank you,emdi how to check no space in flash? do you have a Good method? i think i have enough space
To answer Challen's questions:
If I understand correctly, you are asking if fds automatically deletes the oldest record in flash to make space for a new one. In that case the answer is no, fds won't do that, you have to implement that logic yourself.
Well, that error tells you that there is no space in flash. You can obtain some information by reading the output of fds_stat() although it doesn't directly tell you how much space is available, you'd have to do some math. If you want to store more data in flash, delete an old record, run garbage collection and try again.
Then you could try to run fds_stat() and check the field 'largest_contig': it contains the size (in words) of largest record that you can write to flash at that moment.
If you want to store let's say 128 bytes, first convert that to words: 128/4 = 32. Then check that the resulting value is smaller than 'largest_contig'. If it is, you can fit the data in flash, otherwise you will receive FDS_ERR_NO_SPACE_IN_FLASH. In that case, delete something, run garbage collection and retry.
emdi: fds_stat show log below open_records=2 valid_records=38 dirty_records=16 words_reserved=0 words_used=1021 largest_contig=1024 freeable_words=493
it looks have space ,but log show flash is full,why?