This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FDS wear-leveling not working

Hi

I've just done a few tests with the FDS system of the SDK12.2. My observation is, that the FDS doesn't properly use all assigned flash pages to reach a maximal lifetime.

I have a configuration with the space for the FDS is set to 4 pages. The FDS will use one page as SWAP and the other three pages as DATA pages. My code is writting approximatly 30 records a ~30Bytes to the FDS and randomly updates these records. Once one page is nearly full the garbage collector copies the valid data to the SWAP page and converts the previous SWAP page into a DATA page and the erased page becomes the new SWAP page. Once the new data page is nearly full the valid records are copied back to the SWAP page and so on. In fact only two of the four pages are used.

In my opinion a good flash manager should use all assigned flash pages to reach the maximal possible lifetime. This will allow the developer to add more space to the FDS to increase lifetime.

The problem is based in the fds.c in the function "write_space_reserve" this function always starts at the same position in the flash page list.

Any thoughts how this could be improved?

Adrian

Parents
  • Hi Adrian,

    As I understand, the behaviour you described only happens if you call fds_gc() every time the first page is full. Actually I don't know how you can get an event when one page is full. We only have FDS_ERR_NO_SPACE_IN_FLASH event when all pages are full.

    In the case when all pages are full, and fds_gc() is called by the main application, each page in the fds file system that got erased will be used as swap page.

    So I think it won't be just 2 pages out of 4 will be used as swap page, but rotating around ?

Reply
  • Hi Adrian,

    As I understand, the behaviour you described only happens if you call fds_gc() every time the first page is full. Actually I don't know how you can get an event when one page is full. We only have FDS_ERR_NO_SPACE_IN_FLASH event when all pages are full.

    In the case when all pages are full, and fds_gc() is called by the main application, each page in the fds file system that got erased will be used as swap page.

    So I think it won't be just 2 pages out of 4 will be used as swap page, but rotating around ?

Children
No Data
Related