Hi All,
I am using FlashFS (MDK-ARM V4.22) with an SPI FLASH (Atmel AT45DB321C) and STM32F207.
My problem is that when I delete files using fdelete() the free space (as reported by ffree()) is _never_ recovered, even though the files disappear from the file list (as reported using repeated calls to finfo()). I can delete ALL the files, and NONE of the space is recovered.
I realise that the FLASH can only be erased a block at a time, and indeed the manual says:
"When the file content is modified, the old file content is invalidated and a new memory block is allocated. The Flash Block is erased when all the data stored in the Flash Block have been invalidated."
This is perfectly reasonable. However, this reclamation of space when an entire block is invalidated never seems to happen; ffree() only ever reports a decreasing amount of free space, and I never hit the breakpoint I set on the SPI driver EraseSector() function.
The only way to recover the space seems to be to call fformat() which, as expected, erases the whole FLASH.
Does anyone have any ideas as to what I might be doing wrong?
Thanks in advance,
Christopher Hicks ==
=> Has poilcy about distributing source for FlashFS changed in the last three years, or am I just not looking in the right place?
Policy changed.
http://www.keil.com/forum/18662/ http://www.keil.com/forum/18702/
Danny Curran, 27-Apr-2011 16:16 GMT ----------------------------------- NDA signed and returned was given a link to a zip file and downloaded it. About approx 12 new files and 4 or so changed in the Flash FS Not looked a the USB side but can see differances there as well.