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
  • Hi Bar

    Something like this function should suffice (This function uses the peer manager):

     case PM_EVT_STORAGE_FULL:
            {
                // Run garbage collection on the flash.
                err_code = fds_gc();
                if (err_code == FDS_ERR_BUSY || err_code == FDS_ERR_NO_SPACE_IN_QUEUES)
                {
                    // Retry.
                }
                else
                {
                    APP_ERROR_CHECK(err_code);
                }

    Best regards,

    Simon

  • thanks Simon.

    But what active it?

    I1. which action trigger this case?

    If written to the FLASH trigger this function it will be too late, because I can't make the writing again.

    2. Where I include (init) this handler in my program ?

    3. What is the difference, between my written and this one?

    4. What can I do with the retry? if I still do fds_gc(); I can endup with endless loop?

    Bar.

     

Reply
  • thanks Simon.

    But what active it?

    I1. which action trigger this case?

    If written to the FLASH trigger this function it will be too late, because I can't make the writing again.

    2. Where I include (init) this handler in my program ?

    3. What is the difference, between my written and this one?

    4. What can I do with the retry? if I still do fds_gc(); I can endup with endless loop?

    Bar.

     

Children
No Data
Related