<?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>the record key, what&amp;#39;s the real meaning for it in FDS? how to make difference between two record?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45055/the-record-key-what-s-the-real-meaning-for-it-in-fds-how-to-make-difference-between-two-record</link><description>SDK 14.0, 
 IC:NRF52832 
 I want to save some data in the flash via the FDS. firstly i write 3 records then the next I want to read them one by one according to the record key. 
 Code for me is（I add the fds code used nRF5_SDK_14.0.0_3bcc1f7\examples</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 May 2019 06:52:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45055/the-record-key-what-s-the-real-meaning-for-it-in-fds-how-to-make-difference-between-two-record" /><item><title>RE: the record key, what's the real meaning for it in FDS? how to make difference between two record?</title><link>https://devzone.nordicsemi.com/thread/189453?ContentTypeID=1</link><pubDate>Tue, 28 May 2019 06:52:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d40f1cf7-ac7c-408c-b848-450db366dd4a</guid><dc:creator>zk017</dc:creator><description>&lt;p&gt;OK, awneil, thank you very much teach me to insert c code better!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the record key, what's the real meaning for it in FDS? how to make difference between two record?</title><link>https://devzone.nordicsemi.com/thread/176940?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 10:21:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1506570-84c7-47ae-aefa-d32b63f54c72</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;How to properly post source code:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0576._5F00_Insert-Code-_2D00_-Nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the record key, what's the real meaning for it in FDS? how to make difference between two record?</title><link>https://devzone.nordicsemi.com/thread/176937?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 10:17:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4be8115-09cb-4361-a3d6-62270f06b04a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The FDS documentation describe how this works:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;After the record has been created, you can retrieve its descriptor by using one of the find record functions (&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-3-0/group__fds#ga15112e682cc2c4771945fcf5816e3b1b"&gt;fds_record_find&lt;/a&gt;,&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-3-0/group__fds#gad5a5ad980e0b2b27a693ca5c0296e9c2"&gt;fds_record_find_by_key&lt;/a&gt;, or&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-3-0/group__fds#gaa5bc8844b42493c8d9cdc02d245718fc"&gt;fds_record_find_in_file&lt;/a&gt;). These functions allow you to search for a record based on its record key and file ID.&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;There is no requirement that keys or IDs must be unique. Therefore, more than one record might match the query. The find record functions return one match at a time and keep track of the progress of the operation. They return a status token that encodes the location of the latest match; this token can be used in a subsequent call to continue the search from that position. So to iterate over all matches, you can repeat the call to the find record function using the same token until no more matches are found. See&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-3-0/lib_fds_usage#lib_fds_usage_retrieve"&gt;Retrieving data&lt;/a&gt;&amp;nbsp;for an example on how to enumerate all records with a given key and file ID.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I think your issue is that you actually write the same data to all records. In&amp;nbsp;&lt;span&gt;zk_fds_write, you declare a&amp;nbsp;&lt;/span&gt;&lt;span&gt;static array m_deadbeef. The static keyword will make this variable local to the function, but valid for the lifetime of the program. FDS do asynchronous writes, meaning that you will most likely queue all records for write before they are written to flash. When you do subsequent calls to the write function,&amp;nbsp;m_deadbeef will be overwritten with the data from the new buffer.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you try to make&amp;nbsp;a_buf/b_buf/c_buf static, and pass a pointer to these arrays directly to&amp;nbsp;record.data.p_data in&amp;nbsp;zk_fds_write instead of copying it to a new buffer?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>