<?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>BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59501/ble-fds-problem-to-read-write-fds</link><description>Hello there; My setup: NRF52832 SDK 15.3 I&amp;#39;m facing some problems with FDS when i use it with BLE activated. 
 When i read or write on FDS using fds_record_open or fds_record_update with BLE activated i get fatal erros. But if i dont initialize the BLE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Mar 2020 09:57:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59501/ble-fds-problem-to-read-write-fds" /><item><title>RE: BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/thread/242044?ContentTypeID=1</link><pubDate>Fri, 27 Mar 2020 09:57:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b152e1af-40d5-4f2e-a88a-e80ddbe8a810</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Could you post your full project for us to reproduce and debug this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/thread/241943?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 16:34:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7c6cfb3-9a76-4ee7-8893-f45f093a3f4a</guid><dc:creator>Eng Eink</dc:creator><description>&lt;p&gt;Yes, i&amp;#39;m debugging FDS_EVT_UPDATE by a NRF LOG:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Modelo esta sendo executado.
&amp;lt;info&amp;gt; app: Fast advertising.
&amp;lt;info&amp;gt; app: Event: FDS_EVT_INIT received (FDS_SUCCESS)
&amp;lt;info&amp;gt; app: Escrevendo config file...
&amp;lt;info&amp;gt; app: Event: FDS_EVT_WRITE received (FDS_SUCCESS)
&amp;lt;info&amp;gt; app: Writed!
&amp;lt;info&amp;gt; app: Event: FDS_EVT_UPDATE received (FDS_SUCCESS)
&amp;lt;info&amp;gt; app: Updated!&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After i receive the &amp;quot;Updated!&amp;quot; message i reset the device&lt;br /&gt;&lt;br /&gt;The function to read&amp;nbsp;or write:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t flash_read_n_write(bool wr) {
    ret_code_t rc;
    ret_code_t rc2;
    fds_record_desc_t record_desc = {0};
    fds_find_token_t    ftok;
	
    ftok.page=0;
    ftok.p_addr=NULL;


    static fds_record_t const m_dummy_record =
    {
        .file_id           = FILE_ID,       // ID Onde sera escrito no FDS
        .key               = REC_KEY,       // Chave de Record
        .data.p_data       = &amp;amp;flash_mngt,   // Estrutura onde estar&amp;#227;o os dados que ser&amp;#227;o armazenados na Flash        
        .data.length_words = (sizeof(flash_mngt) + 3) / sizeof(uint32_t), // O tamanho do record &amp;#233; sempre expressado em 4-byte unidades (words)
    }; 
   
         // Procura um record de Flash FDS com os dados configurados anteriormente
         rc = fds_record_find(FLASH_ID, FLASH_REC_KEY, &amp;amp;record_desc, &amp;amp;ftok);

         if (rc == FDS_SUCCESS)
         {
          if(wr) {

                 NRF_LOG_INFO(&amp;quot;Encontrado Records&amp;quot;);
                 // Atualiza&amp;#231;&amp;#227;o do arquivo de config da Flash
                 fds_flash_record_t config = {0};
    
                 // Leitura Flash - Abre a flash FDS e le o conteudo
                 rc = fds_record_open(&amp;amp;record_desc, &amp;amp;config);
                 APP_ERROR_CHECK(rc);
                 NRF_LOG_INFO(&amp;quot;Encntrou records&amp;quot;);
                 // Copia a configuracao da Flash para o m_dummy_cfg
                 memcpy(&amp;amp;flash_mngt, config.p_data, sizeof(flash_mngt));       
                 NRF_LOG_INFO(&amp;quot;Arquivo de config encontrado, atualizando numero de boot p/ %d.&amp;quot;, flash_mngt.boot_cnt);
                 flash_mngt.boot_cnt++;
                 // Fecha a flash FDS
                 rc = fds_record_close(&amp;amp;record_desc);
                 APP_ERROR_CHECK(rc);
                 } else { 
      
                     flash_mngt.test++;
                     // Atualiza a Flash
                     rc2 = fds_record_update(&amp;amp;record_desc, &amp;amp;m_dummy_record);
                     APP_ERROR_CHECK(rc);
                     NRF_LOG_INFO(&amp;quot;GRAVEI!!!!&amp;quot;);
                     return rc;
                 }
       
        } else {
   
       // Configuracao nao encontrada, escreve uma nova
       NRF_LOG_INFO(&amp;quot;Escrevendo config file...&amp;quot;);

       rc = fds_record_write(&amp;amp;record_desc, &amp;amp;m_dummy_record);
       APP_ERROR_CHECK(rc);
   }
  
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The write,update and open works normally without BLE&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/thread/241939?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 16:26:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:300e8f66-c10d-41b1-8c28-04bf4816207d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Did you wait for the FDS_EVT_UPDATE event before resetting the device? If not, the record may not have been successfully written before the reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/thread/241936?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 16:20:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d960d47-b5dd-42b2-aabc-8191cbbb2f66</guid><dc:creator>Eng Eink</dc:creator><description>&lt;p&gt;For now i&amp;#39;m just trying to do these steps for tests:&lt;br /&gt;&lt;br /&gt;1st boot of the device:&lt;br /&gt;- init FDS&lt;br /&gt;- fds_flash_write to write a new config&lt;br /&gt;- fds_update to store a value that represent boot count&lt;br /&gt;&lt;br /&gt;Then i reset the device and hope to:&lt;br /&gt;- Init FDS&lt;br /&gt;- Open the record &amp;lt;&amp;lt;- Error happens&lt;br /&gt;- Close record&lt;br /&gt;- Update the boot count var&lt;br /&gt;&lt;br /&gt;But when i open the record i get the error mentioned before&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/thread/241913?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 15:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42fbdc32-6f3a-49d6-ac0a-a9224d6ab7b5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The error you are seeing is&amp;nbsp;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__fds.html#ggaa156d1cebb38c8a65846c4d9c006012aaedea4ee7787c5ecefba66642afe14ab9"&gt;FDS_ERR_CRC_CHECK_FAILED&lt;/a&gt;. Are you using&amp;nbsp;fds_record_update to update a record before opening the record&amp;nbsp;again? If you are, do you wait for the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__fds.html#gga9374d0e6608b9b07940401b407617f8dadeaba2d3641cb94365a6a641bacdd367"&gt;FDS_EVT_UPDATE&lt;/a&gt;&amp;nbsp;event before opening the record?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/thread/241905?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 14:57:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05deeb04-4a4b-4fae-b762-32fcfefc2b6e</guid><dc:creator>Eng Eink</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;J&amp;oslash;rgen,&lt;br /&gt;&lt;br /&gt;At first ty for your support!&lt;br /&gt;&lt;br /&gt;I built the application with DEBUG and DEBUG_NRF and i got this output at my first writing:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Modelo esta sendo executado.
&amp;lt;info&amp;gt; app: Fast advertising.
&amp;lt;info&amp;gt; app: Event: FDS_EVT_INIT received (FDS_SUCCESS)
&amp;lt;info&amp;gt; app: Escrevendo config file...
&amp;lt;info&amp;gt; app: Event: FDS_EVT_WRITE received (FDS_SUCCESS)
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then i restarted the device and got the error as you can see below:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Modelo esta sendo executado.
&amp;lt;info&amp;gt; app: Fast advertising.
&amp;lt;info&amp;gt; app: Event: FDS_EVT_INIT received (FDS_SUCCESS)
&amp;lt;info&amp;gt; app: Encontrado Records
&amp;lt;error&amp;gt; app: ERROR 13 [NRF_ERROR_TIMEOUT] at C:\Users\W7Pro\Desktop\Nordic_Workspace\#1_Dev\#99_EVK-ANNA-B112\BLE - Servico custom\Components\Src\Flash_FDS.c:271
PC at: 0x0002BA8F
&amp;lt;error&amp;gt; app: End of error report

&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The line 271 represents my call of the function&amp;nbsp;fds_record_open.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;         rc = fds_record_find(FLASH_ID, FLASH_REC_KEY, &amp;amp;record_desc, &amp;amp;ftok);

         if (rc == FDS_SUCCESS)
         {
           NRF_LOG_INFO(&amp;quot;Encontrado Records&amp;quot;);
           //  if(!flash_mngt.ilk_fds_read) {
             // Atualiza&amp;#231;&amp;#227;o do arquivo de config da Flash
             fds_flash_record_t config = {0};
        
             // Leitura Flash - Abre a flash FDS e le o conteudo
 &amp;gt;&amp;gt;&amp;gt;         rc = fds_record_open(&amp;amp;record_desc, &amp;amp;config);
             APP_ERROR_CHECK(rc);
&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;About the use of the softdevice backend for FDS im using the SD:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define FDS_BACKEND 2&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t know why but the error of opening the fds is happening only when i use the device as a central.&lt;br /&gt;&lt;br /&gt;Best regards;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE + FDS Problem to read/write FDS</title><link>https://devzone.nordicsemi.com/thread/241889?ContentTypeID=1</link><pubDate>Thu, 26 Mar 2020 14:27:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:021e3a6a-b251-40c8-ad34-91592855f724</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you build the application with the debug configuration, or with the DEBUG and DEBUG_NRF preprocessor symbols defined? That should help you get the exact error code and location of the error output on the log.&lt;/p&gt;
&lt;p&gt;Are you using the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_fstorage.html#lib_fstorage_backends"&gt;softdevice backend for FDS&lt;/a&gt;, and not the NVMC backend? The NVMC backend will generate a softdevice assert when trying to write/erase flash.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>