Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sometime fds_gc() does not call the user handler.

Hi,

I use the FDS on our project firmware.
The firmware saves some configurations to FDS at shutdown and the factory reset.
At this time, sometime fds_gc() does not call the user handler. (freq = 3/100)

Are there some known bugs?
or
Do you know any informations?

environment:
- SDK15
- nRF52840
- use Softdevice (use peer manager)
- FDS_VIRTUAL_PAGES 5
- FDS_VIRTUAL_PAGE_SIZE 1024
- FDS_BACKEND 2
- FDS_OP_QUEUE_SIZE 8
- FDS_CRC_CHECK_ON_READ 0
- FDS_CRC_CHECK_ON_WRITE 0
- FDS_MAX_USERS 8
- NRF_FSTORAGE_PARAM_CHECK_DISABLED 0
- NRF_FSTORAGE_SD_QUEUE_SIZE 4
- NRF_FSTORAGE_SD_MAX_RETRIES 8
- NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096

  • Hi,

    I added log code and followings  is the log.

    call fds_record_delete().
    > delete_execute()
    > sd_flash_write(0x000fea20, 0x00000001)
    > destination flash value = 0x00240051 (not 0xFFFFFFFF)
    result == FDS_OP_EXECUTING

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > delete_execute()
    call fds_record_write().
    > write_execute()
    > sd_flash_write(0x000fbf0c, 0x00000001)
    > destination flash value = 0xffffffff
    result == FDS_OP_EXECUTING

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > write_execute()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fbf14, 0x00000001)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > write_execute()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fbf18, 0x00000024)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > write_execute()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fbf10, 0x00000001)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > write_execute()


    call fds_record_delete().
    > delete_execute()
    > sd_flash_write(0x000feabc, 0x00000001)
    > destination flash value = 0x00ad0002 (not 0xFFFFFFFF)
    result == FDS_OP_EXECUTING

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > delete_execute()


    call fds_record_write().
    call fds_gc().
    > gc_execute()
    > gc_init()
    > gc_next_page();
    > sd_flash_write(0x000ff008, 0x00000 093)
    > destination flash value = 0xffffffff
    result == FDS_OP_EXECUTING

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_page_erase(0xfe)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_swap_pages()
    > gc_swap_promote()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000ff000, 0x00000002)
    > destination flash value = 0xdeadc0de (not 0xFFFFFFFF)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > case GC_PROMOTE_SWAP: m_gc.state = GC_TAG_NEW_SWAP;
    > gc_tag_new_swap()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fe000, 0x00000002)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > change m_gc.state = GC_NEXT_PAGE
    > gc_next_page()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fe008, 0x000000B0)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fe2c8, 0x000000C5)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fe5dc, 0x00000093)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fe828, 0x00000093)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fea74, 0x00000093)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fecc0, 0x00000093)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fef0c, 0x0000009c)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_page_erase(0xfb)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_swap_pages()
    > gc_swap_promote()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fe000, 0x00000002)
    > destination flash value = 0xdeadc0de (not 0xFFFFFFFF)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > case GC_PROMOTE_SWAP: m_gc.state = GC_TAG_NEW_SWAP;
    > gc_tag_new_swap()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fb000, 0x00000002)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > change m_gc.state = GC_NEXT_PAGE
    > gc_next_page()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fb008, 0x000000B0)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fb2c8, 0x00000093)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_page_erase(0xfc)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_swap_pages()
    > gc_swap_promote()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fb000, 0x00000002)
    > destination flash value = 0xdeadc0de (not 0xFFFFFFFF)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > case GC_PROMOTE_SWAP: m_gc.state = GC_TAG_NEW_SWAP;
    > gc_tag_new_swap()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fc000, 0x00000002)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > change m_gc.state = GC_NEXT_PAGE
    > gc_next_page()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fc008, 0x00000093)
    > destination flash value = 0xffffffff

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_update_swap_offset()
    > gc_record_find_next()
    result == FDS_OP_EXECUTING
    > sd_flash_page_erase(0xfd)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > gc_swap_pages()
    > gc_swap_promote()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fc000, 0x00000002)
    > destination flash value = 0xdeadc0de (not 0xFFFFFFFF)

    > nrf_fstorage_sys_evt_handler()
    > fs_event_handler()
    > gc_execute()
    > case GC_PROMOTE_SWAP: m_gc.state = GC_TAG_NEW_SWAP;
    > gc_tag_new_swap()
    result == FDS_OP_EXECUTING
    > sd_flash_write(0x000fd000, 0x00000002)
    > destination flash value = 0xffffffff

    no nrf_fstorage_sys_evt_handler() event of sd_flash_write !!!

    Thanks,

  • Hello,

    Can you provide which SDK you are using? For instance is it nRF5 SDK v14.2? That will help me find internally if there are any known issues.

    Best regards,
    Kenneth

  • Hi,

    I am using SDK15.
    and My projects is based on ANCS example.

    Thanks,

  • Hi,

    I added debug code (detect timeout and retry sd_flash_write.)
    sd_flash_write returns NRF_ERROR_BUSY.

    Thanks,

  • Hi,

    I want to reset flash module in softdevice.
    Are there the reset API in softdevice?

    Thanks,

Related