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

garbage collection

I need to run gc because I get rc =FDS_ERR_NO_SPACE_IN_FLASH.

So I run gc simple as written in https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_fds_functionality.html?cp=5_1_3_55_1_2#lib_fds_functionality_gc 

I just write this

rc = fds_record_update(&record_desc, &record);
if(rc == FDS_ERR_NO_SPACE_IN_FLASH) // no space in the FLASH
{
  ret_code_t rc = fds_gc();// try to do garbage collection
  if (rc != FDS_SUCCESS)
  {
   /* error handle */
}

}

But just when I do the fds_gc() I get hard fault.

What do I miss here?

Bar.

Parents
  • Hello Bar

    Then, what have you set FDS_VIRTUAL_PAGE_SIZE and FDS_VIRTUAL_PAGES as? Remember that these values should add up with the actual amount of needed flash pages and flash page size. 

    If you'd like, you can send me your project so that I can try to debug it from my side, as I'm still unsure what exactly is causing this hard fault of yours. If you don't want to share your project publicly on DevZone I can set this case to private so that only Nordic engineers will be able to see it.

    Best regards,

    Simon

Reply
  • Hello Bar

    Then, what have you set FDS_VIRTUAL_PAGE_SIZE and FDS_VIRTUAL_PAGES as? Remember that these values should add up with the actual amount of needed flash pages and flash page size. 

    If you'd like, you can send me your project so that I can try to debug it from my side, as I'm still unsure what exactly is causing this hard fault of yours. If you don't want to share your project publicly on DevZone I can set this case to private so that only Nordic engineers will be able to see it.

    Best regards,

    Simon

Children
  • Hi 

    I play with the FDS_VIRTUAL_PAGE_SIZE (1024/2048)and FDS_VIRTUAL_PAGES(3/6) but it just expend the write area before get to the gc. The gc crass when get to the execute.

    I attach a link to the whole project

    https://drive.google.com/open?id=1wMrGyR6BABrZEiQG8R0lDPVpJIehySsT

    The fail get around written list 85. Then when go to fds_gc

    Bar

  • I did anther test.

    Every time before and after fds_gc I active fds_stat(&stat); , and compare the statistic in state.

    I actrive the function in this way:

     rc = fds_stat(&stat); // TEST TEST TEST to see if gc work

     rc = fds_gc();

     rc = fds_stat(&stat); // TEST TEST TEST to see if gc work

    When it wasn't on the limit of the FLASH the gc work fine and if there was dirty record it remove them.

    But when I get to rc == FDS_ERR_NO_SPACE_IN_FLASH and try the same I get before the gc this statistic:

    pages_available= 0x3

    open_records= 0x0

    valid_records= 0x56

    dirty_records=0x55

    words_used= 0x07FA

    largest_contig=0x4

    freeable_words=0x03F5

    corruption=false

    But there it go to hardfault.

    The number looks logical because for ease record I update it in the past, and there is still free words.

    Is this give any clue?

    Bar.

Related