<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64192/fds-garbage-collection-not-clearing-dirty-records</link><description>Hi below is the function i am using to run garbage collection after deleting the data but the result i am getting was the same as before garbage collection. 
 
 I mean DIRTY_RECORDS_BEFORE_GC = DIRTY_RECORDS_AFTER_GC. 
 Do i need to reinitialize the fds</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jul 2020 15:00:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64192/fds-garbage-collection-not-clearing-dirty-records" /><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261834?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 15:00:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:252c3c80-3f04-4463-92e7-59005c7ead4f</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;Yup I tested with the original code but their also same delete function is there and after calling delete i am in while loop with idle state handler. Any in delete function it is not showing proper stat but in while loop where i currently running after delete_all() there i ran the stat then it was coming properly(i.e zero).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261832?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 14:51:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:060ac307-44d4-425f-8683-11ceb0c97d99</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;Thank &lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt; I made changes as you said in the example fortunately it is working fine. i will check with my original code and let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261830?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 14:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4d27b40-1148-47a9-964d-f9897374397a</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;I am sorry to say that i forgot to add fds_gc_complete part in this code but it was their in my original project code already. so i don&amp;#39;t think this is the issue. okay any have i will test with fds_gc_complete and let you know as soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261824?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 14:05:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35ae1d89-95b4-48f5-890a-371f659803d3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks, but you&amp;#39;re calling fds_stat() immediately after calling fds_gc() so the garbage collection does not get time any to complete.&lt;/p&gt;
&lt;p&gt;Code using fds_gc_complete flag:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nordic_common.h&amp;quot;
#ifdef SOFTDEVICE_PRESENT
#include &amp;quot;nrf_sdh.h&amp;quot;
#include &amp;quot;nrf_sdh_ble.h&amp;quot;
#else
#include &amp;quot;nrf_drv_clock.h&amp;quot;
#endif
#include &amp;quot;fds.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_cli.h&amp;quot;
#include &amp;quot;fds_example.h&amp;quot;

#define NRF_LOG_MODULE_NAME app
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;


/* A tag identifying the SoftDevice BLE configuration. */
#define APP_BLE_CONN_CFG_TAG    1

bool volatile fds_delete_complete = false;
bool volatile fds_gc_complete = false;

static void delete_data(uint16_t file_id, uint16_t record_key);
/* Array to map FDS return values to strings. */
char const * fds_err_str[] =
{
    &amp;quot;FDS_SUCCESS&amp;quot;,
    &amp;quot;FDS_ERR_OPERATION_TIMEOUT&amp;quot;,
    &amp;quot;FDS_ERR_NOT_INITIALIZED&amp;quot;,
    &amp;quot;FDS_ERR_UNALIGNED_ADDR&amp;quot;,
    &amp;quot;FDS_ERR_INVALID_ARG&amp;quot;,
    &amp;quot;FDS_ERR_NULL_ARG&amp;quot;,
    &amp;quot;FDS_ERR_NO_OPEN_RECORDS&amp;quot;,
    &amp;quot;FDS_ERR_NO_SPACE_IN_FLASH&amp;quot;,
    &amp;quot;FDS_ERR_NO_SPACE_IN_QUEUES&amp;quot;,
    &amp;quot;FDS_ERR_RECORD_TOO_LARGE&amp;quot;,
    &amp;quot;FDS_ERR_NOT_FOUND&amp;quot;,
    &amp;quot;FDS_ERR_NO_PAGES&amp;quot;,
    &amp;quot;FDS_ERR_USER_LIMIT_REACHED&amp;quot;,
    &amp;quot;FDS_ERR_CRC_CHECK_FAILED&amp;quot;,
    &amp;quot;FDS_ERR_BUSY&amp;quot;,
    &amp;quot;FDS_ERR_INTERNAL&amp;quot;,
};

/* Array to map FDS events to strings. */
static char const * fds_evt_str[] =
{
    &amp;quot;FDS_EVT_INIT&amp;quot;,
    &amp;quot;FDS_EVT_WRITE&amp;quot;,
    &amp;quot;FDS_EVT_UPDATE&amp;quot;,
    &amp;quot;FDS_EVT_DEL_RECORD&amp;quot;,
    &amp;quot;FDS_EVT_DEL_FILE&amp;quot;,
    &amp;quot;FDS_EVT_GC&amp;quot;,
};

/* Dummy configuration data. */
static configuration_t m_dummy_cfg =
{
    .config1_on  = false,
    .config2_on  = true,
    .boot_count  = 0x0,
    .device_name = &amp;quot;dummy&amp;quot;,
};

/* A record containing dummy configuration data. */
static fds_record_t const m_dummy_record =
{
    .file_id           = CONFIG_FILE,
    .key               = CONFIG_REC_KEY,
    .data.p_data       = &amp;amp;m_dummy_cfg,
    /* The length of a record is always expressed in 4-byte units (words). */
    .data.length_words = (sizeof(m_dummy_cfg) + 3) / sizeof(uint32_t),
};

/* Keep track of the progress of a delete_all operation. */
static struct
{
    bool delete_next;   //!&amp;lt; Delete next record.
    bool pending;       //!&amp;lt; Waiting for an fds FDS_EVT_DEL_RECORD event, to delete the next record.
} m_delete_all;

/* Flag to check fds initialization. */
static bool volatile m_fds_initialized;


static void fds_evt_handler(fds_evt_t const * p_evt)
{
    NRF_LOG_GREEN(&amp;quot;Event: %s received (%s)&amp;quot;,
                  fds_evt_str[p_evt-&amp;gt;id],
                  fds_err_str[p_evt-&amp;gt;result]);

    switch (p_evt-&amp;gt;id)
    {
        case FDS_EVT_INIT:
            if (p_evt-&amp;gt;result == FDS_SUCCESS)
            {
                m_fds_initialized = true;
            }
            break;

        case FDS_EVT_WRITE:
        {
            if (p_evt-&amp;gt;result == FDS_SUCCESS)
            {
                NRF_LOG_INFO(&amp;quot;Record ID:\t0x%04x&amp;quot;,  p_evt-&amp;gt;write.record_id);
                NRF_LOG_INFO(&amp;quot;File ID:\t0x%04x&amp;quot;,    p_evt-&amp;gt;write.file_id);
                NRF_LOG_INFO(&amp;quot;Record key:\t0x%04x&amp;quot;, p_evt-&amp;gt;write.record_key);
            }
        } break;

        case FDS_EVT_DEL_RECORD:
        {
            if (p_evt-&amp;gt;result == FDS_SUCCESS)
            {
                fds_delete_complete = true;
                NRF_LOG_INFO(&amp;quot;Record ID:\t0x%04x&amp;quot;,  p_evt-&amp;gt;del.record_id);
                NRF_LOG_INFO(&amp;quot;File ID:\t0x%04x&amp;quot;,    p_evt-&amp;gt;del.file_id);
                NRF_LOG_INFO(&amp;quot;Record key:\t0x%04x&amp;quot;, p_evt-&amp;gt;del.record_key);
            }
            m_delete_all.pending = false;
        } break;

        case FDS_EVT_GC:
        {
            if (p_evt-&amp;gt;result == NRF_SUCCESS)
            {
                fds_gc_complete = true;
            }
        } break;

        default:
            break;
    }
}


/**@brief   Begin deleting all records, one by one. */
void delete_all_begin(void)
{
    m_delete_all.delete_next = true;
}


/**@brief   Process a delete all command.
 *
 * Delete records, one by one, until no records are left.
 */
void delete_all_process(void)
{
    if (   m_delete_all.delete_next
        &amp;amp; !m_delete_all.pending)
    {
        NRF_LOG_INFO(&amp;quot;Deleting next record.&amp;quot;);

        m_delete_all.delete_next = record_delete_next();
        if (!m_delete_all.delete_next)
        {
            NRF_LOG_CYAN(&amp;quot;No records left to delete.&amp;quot;);
        }
    }
}


#ifdef SOFTDEVICE_PRESENT
/**@brief   Function for initializing the SoftDevice and enabling the BLE stack. */
static void ble_stack_init(void)
{
    ret_code_t rc;
    uint32_t   ram_start;

    /* Enable the SoftDevice. */
    rc = nrf_sdh_enable_request();
    APP_ERROR_CHECK(rc);

    rc = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
    APP_ERROR_CHECK(rc);

    rc = nrf_sdh_ble_enable(&amp;amp;ram_start);
    APP_ERROR_CHECK(rc);
}
#else
static void clock_init(void)
{
    /* Initialize the clock. */
    ret_code_t rc = nrf_drv_clock_init();
    APP_ERROR_CHECK(rc);

    nrf_drv_clock_lfclk_request(NULL);

    /* Wait for the clock to be ready. */
    while (!nrf_clock_lf_is_running()) {;}
}
#endif


/**@brief   Initialize the timer. */
static void timer_init(void)
{
    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);
}


/**@brief   Initialize logging. */
static void log_init(void)
{
    ret_code_t rc = NRF_LOG_INIT(NULL);
    APP_ERROR_CHECK(rc);
}


/**@brief   Sleep until an event is received. */
static void power_manage(void)
{
#ifdef SOFTDEVICE_PRESENT
    (void) sd_app_evt_wait();
#else
    __WFE();
#endif
}


/**@brief   Wait for fds to initialize. */
static void wait_for_fds_ready(void)
{
    while (!m_fds_initialized)
    {
        power_manage();
    }
}

#define FILE_ID         0x0001  /* The ID of the file to write the records into. */
#define RECORD_KEY_1    0x1111  /* A key for the first record. */
#define RECORD_KEY_2    0x2222  /* A key for the second record. */
static uint32_t   const m_deadbeef = 0xDEADBEEF;
static char       const m_hello[]  = &amp;quot;Hello, world 2!&amp;quot;;


static void write_data();



//#define FILE_ID     0x1111
//#define RECORD_KEY  0x2222

static void read_data();


int main(void)
{
    ret_code_t rc;

#ifdef SOFTDEVICE_PRESENT
    ble_stack_init();
#else
    clock_init();
#endif

    timer_init();
    log_init();
    cli_init();

    NRF_LOG_INFO(&amp;quot;FDS example started.&amp;quot;)

    /* Register first to receive an event when initialization is complete. */
    (void) fds_register(fds_evt_handler);

    NRF_LOG_INFO(&amp;quot;Initializing fds...&amp;quot;);

    rc = fds_init();
    APP_ERROR_CHECK(rc);

    /* Wait for fds to initialize. */
    wait_for_fds_ready();

    NRF_LOG_INFO(&amp;quot;Available commands:&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- print all\t\tprint records&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- print config\tprint configuration&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- update\t\tupdate configuration&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- stat\t\tshow statistics&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- write\t\twrite a new record&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- delete\t\tdelete a record&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- delete_all\tdelete all records&amp;quot;);
    NRF_LOG_INFO(&amp;quot;- gc\t\trun garbage collection&amp;quot;);

    NRF_LOG_INFO(&amp;quot;Reading flash usage statistics...&amp;quot;);

    fds_stat_t stat = {0};

    rc = fds_stat(&amp;amp;stat);
    APP_ERROR_CHECK(rc);

    NRF_LOG_INFO(&amp;quot;Found %d valid records.&amp;quot;, stat.valid_records);
    NRF_LOG_INFO(&amp;quot;Found %d dirty records (ready to be garbage collected).&amp;quot;, stat.dirty_records);



//    fds_record_desc_t desc = {0};
//    fds_find_token_t  tok  = {0};
//
//    rc = fds_record_find(CONFIG_FILE, CONFIG_REC_KEY, &amp;amp;desc, &amp;amp;tok);
//
//    if (rc == FDS_SUCCESS)
//    {
//        /* A config file is in flash. Let&amp;#39;s update it. */
//        fds_flash_record_t config = {0};
//
//        /* Open the record and read its contents. */
//        rc = fds_record_open(&amp;amp;desc, &amp;amp;config);
//        APP_ERROR_CHECK(rc);
//
//        /* Copy the configuration from flash into m_dummy_cfg. */
//        memcpy(&amp;amp;m_dummy_cfg, config.p_data, sizeof(configuration_t));
//
//        NRF_LOG_INFO(&amp;quot;Config file found, updating boot count to %d.&amp;quot;, m_dummy_cfg.boot_count);
//
//        /* Update boot count. */
//        m_dummy_cfg.boot_count++;
//
//        /* Close the record when done reading. */
//        rc = fds_record_close(&amp;amp;desc);
//        APP_ERROR_CHECK(rc);
//
//        /* Write the updated record to flash. */
//        rc = fds_record_update(&amp;amp;desc, &amp;amp;m_dummy_record);
//        APP_ERROR_CHECK(rc);
//    }
//    else
//    {
//        /* System config not found; write a new one. */
//        NRF_LOG_INFO(&amp;quot;Writing config file...&amp;quot;);
//
//        rc = fds_record_write(&amp;amp;desc, &amp;amp;m_dummy_record);
//        APP_ERROR_CHECK(rc);
//    }






cli_start();
uint32_t record_key = 0x0001;
uint32_t val  = 1000;
while(record_key &amp;lt; 0x0A)
{
  write_data(FILE_ID,record_key,val);
  record_key++;
  val++;
}
record_key = 0x0001;
while(record_key &amp;lt; 0x0A){
      read_data(FILE_ID,record_key);
      record_key++;
}
record_key = 0x0001;
while(record_key &amp;lt; 0x0A)
{
  delete_data(FILE_ID,record_key);
  record_key++;
  }


    /* Enter main loop. */
    for (;;)
    {
        if (!NRF_LOG_PROCESS())
        {
            power_manage();
        }
        cli_process();
        delete_all_process();
    }
}


static void write_data(uint32_t file_id,uint32_t record_key,uint32_t data)
{
ret_code_t rc;
fds_record_t        record;
fds_record_desc_t   record_desc = {0};

// Set up record.
record.file_id           = file_id;
record.key               = record_key;
record.data.p_data       = &amp;amp;data;
/* The following calculation takes into account any eventual remainder of the division. */
record.data.length_words = 1/*(sizeof(data) + 3) / 4*/;
rc = fds_record_write(&amp;amp;record_desc, &amp;amp;record);

if (rc == FDS_SUCCESS)
{
    NRF_LOG_INFO(&amp;quot;data success %d&amp;quot;,record_key);
    while (!NRF_LOG_PROCESS());
    cli_process();
    // Handle error.
}
else{
NRF_LOG_INFO(&amp;quot;error writing&amp;quot;);
}
}


static void read_data(uint32_t file_id,uint32_t record_key)
{
ret_code_t rc;
fds_flash_record_t  flash_record;
fds_record_desc_t   record_desc = {0};
fds_find_token_t    ftok = {0};
  /* It is required to zero the token before first use. */
memset(&amp;amp;ftok, 0x00, sizeof(fds_find_token_t));
/* Loop until all records with the given key and file ID have been found. */
if (fds_record_find(file_id, record_key, &amp;amp;record_desc, &amp;amp;ftok) == FDS_SUCCESS)
{
     //NRF_LOG_INFO(&amp;quot;record_found&amp;quot;);
    if (fds_record_open(&amp;amp;record_desc, &amp;amp;flash_record) != FDS_SUCCESS)
    {
        NRF_LOG_INFO(&amp;quot;opening_error&amp;quot;);
        /* Handle error. */
    }
//    char data[16];
//    memcpy(&amp;amp;data,flash_record.p_data,sizeof(data));
//    for(int i=0;i&amp;lt;sizeof(data);i++)
//    {
//      NRF_LOG_INFO(&amp;quot;%c&amp;quot;,data[i]);
//    }
    uint32_t recorded_data = 0;
    memcpy(&amp;amp;recorded_data,flash_record.p_data,sizeof(recorded_data));
    NRF_LOG_INFO(&amp;quot;recorded_data : %d&amp;quot;,recorded_data);
    while (!NRF_LOG_PROCESS());
    cli_process();
    /* Access the record through the flash_record structure. */
    /* Close the record when done. */
    if (fds_record_close(&amp;amp;record_desc) != FDS_SUCCESS)
    {
        NRF_LOG_INFO(&amp;quot;error closing the file&amp;quot;);
        /* Handle error. */
    }
}
else{
NRF_LOG_INFO(&amp;quot;no data &amp;quot;);
}
}
/**
 * @}
 */


static void delete_data(uint16_t file_id, uint16_t record_key) {
  NRF_LOG_INFO(&amp;quot;deleting records...&amp;quot;);
  ret_code_t rc;
  fds_flash_record_t flash_record;
  fds_record_desc_t record_desc = {0};
  fds_find_token_t ftok = {0};
  /* It is required to zero the token before first use. */
  memset(&amp;amp;ftok, 0x00, sizeof(fds_find_token_t));
  /* Loop until all records with the given key and file ID have been found. */
  int err = fds_record_find(file_id, record_key, &amp;amp;record_desc, &amp;amp;ftok);
  if (err == FDS_SUCCESS) {
    ret_code_t ret = fds_record_delete(&amp;amp;record_desc);
    while (!fds_delete_complete);
    fds_delete_complete = false;
    if (ret == FDS_SUCCESS) {
      NRF_LOG_INFO(&amp;quot;delete suc..&amp;quot;);
    }
    fds_gc();
    while (!fds_gc_complete);
    fds_gc_complete = false;
    fds_stat_t stat = {0};
     rc = fds_stat(&amp;amp;stat);
     APP_ERROR_CHECK(rc);
     NRF_LOG_INFO(&amp;quot;dirty records after gc %d&amp;quot;, stat.dirty_records);
  }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261749?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 09:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e11b97e-5ba3-4f30-af21-313f924254ee</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8688.main.c"&gt;devzone.nordicsemi.com/.../8688.main.c&lt;/a&gt;I attached Modified flash_fds example from SDK 15.3.0 to reproduce the issue. But one thing i am not able to understand was if i send &amp;#39;stat&amp;#39; command via putty-Terminal then it gives dirty records as &amp;#39;0&amp;#39;. How come?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261747?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 09:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67ca0554-6e40-419a-b4e5-f67576189179</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;This is the project I am doing so its difficult to disclose in public. If any other source is there to upload my project privately then it is fine for me or else i will re-produce the issue with some code snippet and post it here within some couple of minutes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261735?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:51:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67c2e561-3d7f-43d3-aac3-de4007f26cab</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Are you able to upload your project so I can try to debug it here? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261732?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:47:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:247310ee-5886-4fd9-8247-9caab7315e51</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;Yes exactly the same whatever you mentioned i was doing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261730?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d003f313-7081-4529-aee1-7b9e017d3f07</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;But do you check the event result in the FDS_EVENT_GC case? &lt;/p&gt;
&lt;p&gt;e.g.,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case FDS_EVT_GC:
        {
            if (p_evt-&amp;gt;result == NRF_SUCCESS)
            {
                fds_gc_complete=true
            }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261728?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:35:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cfdd6b5-b0ad-4a98-bbdd-785dfaf1477a</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;Yes fds_gc_complete is declared as volatile and in event handler i am making it true under FDS_EVENT_GC switch case. Even i put some delay for the fds to complete its operation properly but no use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261727?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:31:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8285cca-f040-47f8-907d-657982ba7388</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Ok, thanks for confirming. The issue I had in mind was fixed before SDK v15.3.0 so it must be something else. A couple of follow up questions: is the &amp;#39;fds_gc_complete&amp;#39; declared volatile and do you check that the event result is&amp;nbsp;NRF_SUCCESS before you set&amp;nbsp;fds_gc_complete=true ? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261725?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:24:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:524a32bd-781a-4d52-956d-ccff92dc7458</guid><dc:creator>Yogeshwaran</dc:creator><description>&lt;p&gt;SDK 15.3.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS garbage collection not clearing dirty records</title><link>https://devzone.nordicsemi.com/thread/261724?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2020 08:17:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd5faa4a-7f10-4850-a398-a6374a49faf3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Which SDK version are you using? Early versions of the FDS had a bug that caused the record statistics to not get updated after GC if I remember correctly.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>