<?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>Assistance with FDS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19496/assistance-with-fds</link><description>Hi,
I am testing github.com/.../nRF52-fds-example 
 I am on nrf52832 with sdk 12.2.0 .
I can&amp;#39;t seem to make it work.
What i have done: 
 
 Separated FDS stuff to separate file 
 Exposed the functions which are used by main file 
 Added files to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Feb 2017 15:19:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19496/assistance-with-fds" /><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75743?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2017 15:19:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e7661cd-4624-4d59-82a2-bf42d008c74a</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;Yes i have tryed. I did&amp;#39;t have to time to go deep into this problem. I wil come back when i grab some extra time. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75742?ContentTypeID=1</link><pubDate>Wed, 08 Feb 2017 10:44:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d86ecc1-c52d-4cb2-aefd-e2579dd4157e</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;As it is put in a BLE example, it needs to be run with a softdevice present, S132 v.3.0.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75737?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2017 15:06:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:537c46cc-bbab-4666-a6ab-476856adf78e</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;For some reason you code doesn&amp;#39;t execute to end, i have turned on the DEBUG flag and waiting for the breakpoint but there is none. I will try to add your code to my project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75736?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2017 13:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c21ad97-5c2d-4557-af31-cf3631213fff</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I  have updated my answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75741?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2017 07:44:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c85f180c-e1c5-4f94-a9db-181bd25031c1</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;Am i doing something wrong? When i write i got &lt;code&gt;Writing Record ID = 1&lt;/code&gt; message. But it does not read anything. I have &lt;code&gt;#define FILE_ID 0x0022&lt;/code&gt; and &lt;code&gt;#define REC_KEY 0x0022&lt;/code&gt; as it is described on &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Flib_trace.html&amp;amp;cp=4_1_0_3_6"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75740?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 13:38:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:410f3600-e839-48c0-841d-b1d69cb270f2</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;In the code is a while loop. If it finds anything it enters the loop and prints out the content? Isn&amp;#39;t that the procedure?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75739?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 13:33:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e288637b-590c-4438-8b17-ddc0889f40d1</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;How do you check if the KEY/ID was found or not?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75738?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 13:32:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:def070da-ab8a-42a3-ae2f-22e891c4ef10</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;Yes. This is the issue. That it did not find the KEY/ID. If you look at the code &lt;a href="https://github.com/hubuhubu/nRF52-fds-example/blob/master/main.c#L1267"&gt;github.com/.../main.c&lt;/a&gt; you can see that it returns 0 and does not print the data if data is not found.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75735?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 13:15:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fb7ce97-f00a-46cc-b157-bdd96b476bcf</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;If you have a look at the fds_read() and the other fds test functions, they will return NRF_SUCCESS upon a successful operation/when it works correctly.&lt;/p&gt;
&lt;p&gt;NRF_SUCCESS is defined the following way:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_ERROR_BASE_NUM      (0x0)       ///&amp;lt; Global error base
#define NRF_SUCCESS                           (NRF_ERROR_BASE_NUM + 0)  ///&amp;lt; Successful command
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It means that when fds_read returns &amp;#39;0&amp;#39;, it returns NRF_SUCCESS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75734?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 13:08:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64a141ff-3dfb-4d89-a88b-64e185e10980</guid><dc:creator>schef</dc:creator><description>&lt;p&gt;It returns 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assistance with FDS</title><link>https://devzone.nordicsemi.com/thread/75733?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 12:50:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72131c7a-32e1-4886-b5c4-5549a836b19a</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Which error code does fds_read() return?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 07.02.2017:&lt;/strong&gt; fds_read() should not return NRF_SUCCESS unless it successfully found the record, if it doesn&amp;#39;t find the record, the error code should be returned.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static ret_code_t fds_read(void)
{
	#define FILE_ID     0x1111
	#define REC_KEY     0x2222
	fds_flash_record_t  flash_record;
	fds_record_desc_t   record_desc;
	fds_find_token_t    ftok ={0};//Important, make sure you zero init the ftok token
	uint32_t *data;
	uint32_t err_code;
	
	NRF_LOG_INFO(&amp;quot;Start searching... \r\n&amp;quot;);
	// Loop until all records with the given key and file ID have been found.
	while (fds_record_find(FILE_ID, REC_KEY, &amp;amp;record_desc, &amp;amp;ftok) == FDS_SUCCESS)
	{
			err_code = fds_record_open(&amp;amp;record_desc, &amp;amp;flash_record);
			if ( err_code != FDS_SUCCESS)
			{
				return err_code;		
			}
			
			NRF_LOG_INFO(&amp;quot;Found Record ID = %d\r\n&amp;quot;,record_desc.record_id);
			NRF_LOG_INFO(&amp;quot;Data = &amp;quot;);
			data = (uint32_t *) flash_record.p_data;
			for (uint8_t i=0;i&amp;lt;flash_record.p_header-&amp;gt;tl.length_words;i++)
			{
				NRF_LOG_INFO(&amp;quot;0x%8x &amp;quot;,data[i]);
			}
			NRF_LOG_INFO(&amp;quot;\r\n&amp;quot;);
			// Access the record through the flash_record structure.
			// Close the record when done.
			err_code = fds_record_close(&amp;amp;record_desc);
			if (err_code != FDS_SUCCESS)
			{
				return err_code;	
			}
	}
	return NRF_SUCCESS;		
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When fds_record() is running, does it print the starting string, &amp;quot;start searching&amp;quot;?&lt;/p&gt;
&lt;p&gt;Could you test the example I have been using for the testing, so that it is easier to compare your results with my results? It is the example from github placed in ble_app_hrs (SDK 12.2),to be used with S132 v. 3.0.0: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_hrs_2D00_fds_2D00_test_2D00_github.zip"&gt;ble_app_hrs-fds-test-github.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the sdk_config.h  file, you can change the logging module to use RTT instead of UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>