<?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>Can&amp;#39;t manage to read from flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22241/can-t-manage-to-read-from-flash</link><description>Hi,
Following the docs I think I am able to write to flash but it will not read anything . 
 This is how I set it up, write and read : 
 static void sys_evt_dispatch(uint32_t sys_evt)
{
 fs_sys_event_handler(sys_evt);
 ble_advertising_on_sys_evt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 May 2017 10:52:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22241/can-t-manage-to-read-from-flash" /><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87384?ContentTypeID=1</link><pubDate>Tue, 23 May 2017 10:52:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5471c119-7504-4833-8880-68476205f434</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;This problem is continued in &lt;a href="https://devzone.nordicsemi.com/question/139450/cant-get-a-callback-from-fds-no-matter-what-help/"&gt;this&lt;/a&gt; thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87383?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 16:41:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83f83808-e02a-48ca-ae95-ea6cffccc1b4</guid><dc:creator>Lola</dc:creator><description>&lt;p&gt;So after trying and reading everything, I can say that the problem is that when I write, I get no callback on the &lt;strong&gt;fds_evt_handler&lt;/strong&gt; , which &lt;strong&gt;DOES&lt;/strong&gt; give me a callback when I init the fds. I MUST say that this code works together with the blu_uart, I have tried to set the ble after it, and also before it, non worked. What else could I explore here ? there are no error messages when I write, nothing happens, I even get success(=0) on the ret value after I write. Maybe the process is wrong ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87382?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 15:27:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7071ed0-6fcb-4f48-8ada-07220c0fe432</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Also full description of FDS is &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.0.0%2Fgroup__fds.html"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87381?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 15:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71f1e9f2-1f87-456e-b44d-657f0055500c</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;By the way, see if this thread can help you &lt;a href="https://devzone.nordicsemi.com/question/88122/fds-updating-existing-records-with-fds_record_update/"&gt;link text&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87380?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 15:23:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00b771cf-0e82-44d8-b87d-eb4cd48e76e7</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;I can&amp;#39;t tell you at the moment why no event come up but regarding full chip, as far as I understand you need to call &lt;code&gt;fds_record_write&lt;/code&gt; once to create record in flash. If you want to update record in flash then &lt;code&gt;fds_record_update&lt;/code&gt; has to be called.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87387?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 15:08:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb9172f1-d21d-45ff-bceb-86171d8ce78a</guid><dc:creator>Lola</dc:creator><description>&lt;p&gt;Thanks a lot, i erased the chip, now we back to the previous one, where nothing happens after the save.. means there is no error and the handler is not being called (only on init)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87386?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 15:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9473809e-43be-442b-b6ad-1a2526df18b7</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;I don&amp;#39;t know what happened but suspect that you run your code several times and it allocates record every time so you run out of space. Try to erase chip, program code and start it again printing all events, even unsuccessful:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void fds_evt_handler(fds_evt_t const * const p_fds_evt)
{
    switch (p_fds_evt-&amp;gt;id)
    {
NRF_LOG_INFO(&amp;quot;fds event: %d %d\r\n&amp;quot;, p_fds_evt-&amp;gt;id, (p_fds_evt-&amp;gt;result);
        case FDS_EVT_INIT:
            if (p_fds_evt-&amp;gt;result != FDS_SUCCESS)
            {
                 NRF_LOG_INFO(&amp;quot;failed initializing\r\n&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87385?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 14:54:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20c61428-0c89-44f0-b27b-2a1439c9c30b</guid><dc:creator>Lola</dc:creator><description>&lt;p&gt;Thanks it&amp;#39;s 7 , where do I find what 7 is ? does it means FDS_ERR_NO_SPACE_IN_FLASH  ? if so , how is that possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87379?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 14:39:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:718824f7-2b3c-4ed4-9cbd-4b613d69e2fd</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;In Write function you have:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  ret_code_t ret = fds_record_write(&amp;amp;record_desc, &amp;amp;record);
  if (ret != FDS_SUCCESS)
  {
       NRF_LOG_INFO(&amp;quot;FAILED TO SAVE\r\n&amp;quot;); 
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What is the value of &lt;code&gt;ret&lt;/code&gt; variable when you have FAILED TO SAVE? Then find description of &lt;code&gt;fds_record_write&lt;/code&gt; to find out error code explanation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87378?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 14:37:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:323b8c19-4bc9-4be0-8205-a4ef548f1aec</guid><dc:creator>Lola</dc:creator><description>&lt;p&gt;What? I am not sure I get what you are saying, find it where ?  and what to do with it ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87377?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 14:09:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91d95ca2-0ff9-4741-9c33-33972ba70719</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;You need to find out ret code from &lt;code&gt;fds_record_write(&amp;amp;record_desc, &amp;amp;record);&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87376?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 14:05:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eba351e2-dca7-4656-ba98-b03b0a8a9bd8</guid><dc:creator>Lola</dc:creator><description>&lt;p&gt;Yes, I receive the init event good ,thanks. Well now it suddenly started printing &amp;quot;FAILED TO SAVE&amp;quot; ( please take a look at the write() function where I print it)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87375?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 14:01:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d25c468-ce1f-485f-9386-0b0aaf4338b4</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Do you receive FDS_EVT_INIT?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87374?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 13:55:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ade40434-63f2-4293-9e4e-281a6e425592</guid><dc:creator>Lola</dc:creator><description>&lt;p&gt;@Alex It will not even get into the case FDS_EVT_WRITE , so I put your line in there and it will not print it at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't manage to read from flash</title><link>https://devzone.nordicsemi.com/thread/87373?ContentTypeID=1</link><pubDate>Mon, 22 May 2017 13:53:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:577ae2fa-ab20-4c81-ae18-21e615382995</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;It means Write started but not finished. Try in event handler log result:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;       case FDS_EVT_WRITE:
NRF_LOG_INFO(&amp;quot;write result %d\r\n&amp;quot;,p_fds_evt-&amp;gt;result); 
       if (p_fds_evt-&amp;gt;result == FDS_SUCCESS)
           {
               write_flag=1;
                NRF_LOG_INFO(&amp;quot;finish write\r\n&amp;quot;); 
           }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>