<?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>FDS Problems in SDK12.1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23328/fds-problems-in-sdk12-1</link><description>Hi All, 
 I&amp;#39;ve integrated the flash routines from this example:
 github.com/.../nRF52-fds-example 
into my project, and am having problems figuring out the architecture. 
 I&amp;#39;m using:
Keil uVision v5.22.0.0,
SDK 12.1.0.0,
Softdevice 3.0, and
nRF52832</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Jul 2017 20:49:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23328/fds-problems-in-sdk12-1" /><item><title>RE: FDS Problems in SDK12.1</title><link>https://devzone.nordicsemi.com/thread/91718?ContentTypeID=1</link><pubDate>Wed, 12 Jul 2017 20:49:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d2d0b4d-1087-4942-bac3-2cfa9deb5b42</guid><dc:creator>robinvice</dc:creator><description>&lt;p&gt;OK, Hung Bui, you solved it.
sys_evt_dispatch() wasn&amp;#39;t calling fs_sys_event_handler(sys_evt).
Once I added that, it started working.
Thanks for your valuable help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Problems in SDK12.1</title><link>https://devzone.nordicsemi.com/thread/91717?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2017 12:19:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:352f6ba1-6666-4a2f-8467-78f36e2cbe88</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Robin,&lt;/p&gt;
&lt;p&gt;The loop to wait for the write_flag to be set is needed. Note that the write_flag should only be set inside the callback handler you registered, in this case my_fds_evt_handler().&lt;/p&gt;
&lt;p&gt;Also make sure this     fs_sys_event_handler(sys_evt); is called inside sys_evt_dispatch() so that fstorage can track the callback from the softdevice.&lt;/p&gt;
&lt;p&gt;I attached here a project that I write to 2 records instead of one. It worked fine (SDKv12.1).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_proximity-_2D00_-TestFDS.zip"&gt;ble_app_proximity - TestFDS.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Problems in SDK12.1</title><link>https://devzone.nordicsemi.com/thread/91716?ContentTypeID=1</link><pubDate>Sat, 08 Jul 2017 00:26:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebb2ae5b-41f7-4a7a-9e49-edb7f89ccce7</guid><dc:creator>robinvice</dc:creator><description>&lt;p&gt;I was able to see the header being written only by commenting out the &lt;strong&gt;wait&lt;/strong&gt; that appeared after the call to the write function (as shown below):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    		err_code = fds_test_write();
		APP_ERROR_CHECK(err_code);
		NRF_LOG_INFO(&amp;quot;fds_test_write() err_code = %ld\r\n&amp;quot;, err_code);	
		//wait until the write is finished. 
//		while (write_flag==0)
//		{
//			write_flag = 1;
//		}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With the while commented out, the error codes returned by the following are all zero:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	err_code = fds_test_init();
	err_code = fds_test_find_and_delete();
	err_code = fds_test_write();
	err_code = fds_read();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When uncommented and allowed to run, the while loop is infinite. The fds_evt_t named p_fds_evt passed to my_fds_evt_handler() contains an id of FDS_EVT_WRITE the first time through.  The second time through, it contains FDS_EVT_GC.  There are no more calls to it after that, so the write flag never gets set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Problems in SDK12.1</title><link>https://devzone.nordicsemi.com/thread/91715?ContentTypeID=1</link><pubDate>Fri, 07 Jul 2017 16:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c55ccab5-bdca-492c-9327-6b2df391386b</guid><dc:creator>robinvice</dc:creator><description>&lt;p&gt;There&amp;#39;s a comment at the end of the write_execute() function that says there won&amp;#39;t be a callback.  I don&amp;#39;t know why there isn&amp;#39;t a callback, and I don&amp;#39;t know how the other members of the switch statement would ever execute without it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// An operation has either completed or failed. It may have failed because fstorage
// ran out of memory, or because the user tried to delete a record which did not exist.
if (ret != FDS_OP_EXECUTING)
{
    // There won&amp;#39;t be another callback for this operation, so update the page offset now.
    page_offsets_update(p_page, p_op-&amp;gt;write.header.tl.length_words);
}

return ret;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Perhaps p_op remains in the queue, but with its .step value incremented?
Can you help me understand this part?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS Problems in SDK12.1</title><link>https://devzone.nordicsemi.com/thread/91714?ContentTypeID=1</link><pubDate>Fri, 07 Jul 2017 14:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48e44406-0615-4cf2-849c-7dc966ccb6d3</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Robin,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not quite sure what the problem you are having ?&lt;/p&gt;
&lt;p&gt;Were you able to queue any write after 		fds_test_write(); ?
Note that you need to wait for the  callback (in this case my_fds_evt_handler() ) to be sure that the data is written to flash.&lt;/p&gt;
&lt;p&gt;If you step through the code, it will crash at any Softdevice API call, because the softdevice stops working when you stepping in the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>