<?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>[PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14363/pca10040-sdk11-fds-unable-to-read-closed</link><description>Hi 
 I have been able to successfully write using FDS but I&amp;#39;m unable to read back using the same keys. Here are my code snippets: 
 #define FILE_ID 0x1111
#define REC_START_ID 0x2222
uint32_t rec_count	= 0;

static void fds_timer_timeout_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Jun 2016 09:24:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14363/pca10040-sdk11-fds-unable-to-read-closed" /><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54847?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 09:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a0c5a76-ad00-4ec6-9076-db9ce37817e1</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Excellent!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54846?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 09:19:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ef4546d-8ddc-4a0c-b632-ebef49efba6a</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;Found the solution. The problem was I was not initializing the fds_find_token_t ftok, which in &lt;a href="https://github.com/hubuhubu/nRF52-fds-example"&gt;this&lt;/a&gt; example has been marked as very important. Should have read the comments :/ Everything is working fine now.&lt;/p&gt;
&lt;p&gt;Anyway thanks RichieJH for helping.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54845?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 08:44:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13451c8f-4f93-4446-9da8-b348262a976d</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Ah, ok I see.  A couple of other things, are your flags working as you imagine?  You are defining a global rec_count and manipulating that it a number of different places.  Is it the value you imagine when trying to read a record?  You are debugging almost identical sentences at different places, is there a chance you are misinterpreting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54844?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 08:19:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:914f8e72-9d88-440e-aa97-23e1cb89407d</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;I have commented peer_manager_init in the main as I&amp;#39;m not using any BLE functions. That&amp;#39;s why I&amp;#39;m calling fds_init separately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54843?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2016 07:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f1b5df1-35bb-4633-bf63-4ca5d864837a</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;I see you are calling fds_init when the peer manager does this.  This can lead to strange behaviour, especially early on.  Also most fds returns are call successes, not operational successes.  So don&amp;#39;t be fooled into believing something has happened because the return is nil.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54835?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 10:21:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc086a72-32bf-45d4-b292-499416be91e7</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;I&amp;#39;m a simple guy, so if I was you I would first check if I could find the record in main and then work up from there.  Flash is asynchronous so to try and do things in an interrupt at the wrong priority is not going to be ideal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54834?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 10:15:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5113995-4542-4941-b794-ecee933f3876</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;I have checked it many times, the err_code is 10. In the fds_evt_handler I&amp;#39;m getting a valid record id on written event, so I guess it is safe to assume that the write is done successfully. I have also tried keeping the record.key same and searching with the same key, but with no success. One thing I&amp;#39;d lforgotten to mention is that I&amp;#39;m trying to read the data in a timer timeout handler. I&amp;#39;ve attached the main file as an edit to the question in case I might have missed something else that needs mentioning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54836?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 08:59:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdda85ad-ecf5-48c7-8a14-81495f6ab187</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Providing the err_code is 10 (i.e., not able to find record) and not some other error code then it is a mystery.  Perhaps avoid the increment to the record number in the fds_record_find() call itself but providing you have written successfully then that is call that should yield success.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54842?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 08:22:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:049f9d95-b04a-497c-a024-cacfce082bea</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;Yes, i have made sure that the fds is initialized only once. Also i think thewrite is done properly as in the FDS_EVT_WRITE I&amp;#39;m getting a valid record id. Is there any other method to check that the write is done properly? I have used the above code as a guide in writing my current code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54841?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 07:42:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce58fe76-1d28-4275-99a0-2ad07de2ec6c</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;I think the peer manager initialises FDS, so be careful you are not doing it twice as this can lead strange behaviour.  More on that here &lt;a href="https://devzone.nordicsemi.com/question/78487/fds-sample-code/"&gt;https://devzone.nordicsemi.com/question/78487/fds-sample-code/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54840?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 06:54:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:769e68b3-52ab-407c-9b35-febec2578ba1</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;Yes i am. I have used app proximity example for pca10040 as starting point which uses peer manager and fds, the function has been called inside sys_evt_dispatch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54839?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 06:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0693c6d3-6400-47b4-be34-8e4e4249863a</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Are you calling this &lt;code&gt;void fs_sys_event_handler( uint32_t sys_evt )&lt;/code&gt; anywhere in your code?  Without this it may appear to be writing correct but it won&amp;#39;t be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54838?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 04:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7479d62-7996-4b9b-a243-173566233c33</guid><dc:creator>Lalit Kumar</dc:creator><description>&lt;p&gt;I can see that writing is done successfully. Fds_record_find return fds_error_not_found meaning the record was not found. I am assuming that the key that is being given to fds_record_find is the record.key and not the record key returned by record_desc as they are different. Any suggestions on what should i look for in debug?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PCA10040][SDK11] FDS unable to read [closed]</title><link>https://devzone.nordicsemi.com/thread/54837?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2016 21:34:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afca2547-46f9-4840-9f8f-2ac6fcd1960f</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;You have plenty of debug messages and err_codes set - what are you seeing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>