<?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>Turn off and on nrf51dk to test fds with what tool to view output</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28155/turn-off-and-on-nrf51dk-to-test-fds-with-what-tool-to-view-output</link><description>Hi, 
 I managed to get fds to store some information in nrf51dk for persistent data storage. I would like to check if the data is still available in the chip after power off and on. I have been using SEGGER RTT viewer and Eclipse IDE to compile the code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Dec 2017 12:35:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28155/turn-off-and-on-nrf51dk-to-test-fds-with-what-tool-to-view-output" /><item><title>RE: Turn off and on nrf51dk to test fds with what tool to view output</title><link>https://devzone.nordicsemi.com/thread/111201?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 12:35:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da4b3a44-43f9-48e0-a3b8-3076491426c5</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Try to close the Segger RTT viewer, and start it again, and connect with it again. When you re-connect with Segger RTT the output should be printed. Then you can have a function that prints the fds data after fds initialization.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn off and on nrf51dk to test fds with what tool to view output</title><link>https://devzone.nordicsemi.com/thread/111199?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 14:52:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05c1aa0a-2417-4510-a406-3696f0ea5f9e</guid><dc:creator>jj</dc:creator><description>&lt;p&gt;Yes I know. What I meant is, how can I check that the data is stored in the fds without having to be running it at the same time with the code? If I were to power off Nordic chip then turn back on, SEGGER RTT will not be able to display the printed output as it did previously when I run the code before it was turn off. So how can I view the printed output after I do a power off then on again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Turn off and on nrf51dk to test fds with what tool to view output</title><link>https://devzone.nordicsemi.com/thread/111200?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 09:51:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34957133-5f80-44ea-9299-55963657dcc2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you store data to flash using the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/lib_fds.html?cp=4_0_0_3_50"&gt;FDS module&lt;/a&gt;, you store your data with a FILE_ID and one or several keys where records are stored. E.g. File 1 with two records: 0x1111=&amp;quot;Phone1&amp;quot;, 0x2222=&amp;quot;data: 12345&amp;quot;. Before you store your data you define these IDs and keys:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#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. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When you turn off/on your device, you can use these keys to retrieve the data you stored. This can be done like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define FILE_ID     0x1111
#define RECORD_KEY  0x2222
fds_flash_record_t  flash_record;
fds_record_desc_t   record_desc;
fds_find_token_t    ftok;
/* 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. */
while (fds_record_find(FILE_ID, RECORD_KEY, &amp;amp;record_desc, &amp;amp;ftok) == FDS_SUCCESS)
{
    if (fds_record_open(&amp;amp;record_desc, &amp;amp;flash_record) != FDS_SUCCESS)
    {
        /* Handle error. */
    }
    /* Access the record through the flash_record structure. */

    //Here you can print your data with Segger RTT or over UART
    /* Close the record when done. */
    if (fds_record_close(&amp;amp;record_desc) != FDS_SUCCESS)
    {
        /* Handle error. */
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also take a look at how it&amp;#39;s done &lt;a href="https://github.com/NordicPlayground/nRF5-flash-storage-examples/blob/master/fds_example/main.c#L1267"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>