<?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 in sdk14</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25160/fds-in-sdk14</link><description>I&amp;#39;m trying to migrate my old app based on buttonless app sdk13 to buttonless app sdk14.
I solved issuie according to migrate guide remove chunk things and etc.
My app works well until I add fds_init function in my main.c file. 
Here&amp;#39;s my fds_test_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 16 Sep 2017 03:32:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25160/fds-in-sdk14" /><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99118?ContentTypeID=1</link><pubDate>Sat, 16 Sep 2017 03:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:569df222-819f-40c3-bca7-1fd8c07a5bde</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Now it works. I added init flag:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   case FDS_EVT_INIT:
            if (p_fds_evt-&amp;gt;result != FDS_SUCCESS)
            {
                // Initialization failed.
            }
						init_flag = 1;
            break;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and before calling fds_write_value wait of flag change&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(init_flag == 0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks. In my code in SDK13 I shouldn&amp;#39;t do it and in &lt;a href="https://github.com/hubuhubu/nRF52-fds-example/blob/master/main.c"&gt;example on github&lt;/a&gt; too. Probably some new changes in sdk14&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99110?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2017 09:28:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aeef85a2-fd3e-4b70-98d8-b7a7827e851d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The error codes are &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/group__fds.html#ga157d5577a5b2f5986037d0d09c7dc77d"&gt;described here&lt;/a&gt;. Error code 2 should mean &lt;code&gt;FDS_ERR_NOT_INITIALIZED&lt;/code&gt; - &lt;em&gt;Error. The module has not been initialized.&lt;/em&gt; Are you getting the &lt;code&gt;FDS_EVT_INIT&lt;/code&gt; event before you are calling &lt;code&gt;fds_record_write&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99111?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2017 09:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f99650c4-87f0-4f7b-8028-8f95fc194d7f</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Thanks now I get rid of this issue, but after add fds_record_write function I get fatal_error, check ret&amp;#39;s value via debug it&amp;#39;s 2. Can&amp;#39;t find what does it means.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99119?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2017 07:20:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71a4506e-104d-42c7-b35e-8ca9829afe39</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Notice the note in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/lib_fds_usage.html?cp=4_0_0_3_48_2_0#lib_fds_usage_init"&gt;FDS documentation&lt;/a&gt; saying &amp;quot;Before initializing FDS, you must initialize the SoftDevice and register a callback handler to handle FDS events&amp;quot;. In your main-function, you are calling &lt;code&gt;fds_test_init()&lt;/code&gt; before &lt;code&gt;ble_stack_init()&lt;/code&gt;. This will lead to a hardfault, as the softdevice calls used in fstorage backend &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/lib_fstorage.html?cp=4_0_0_3_49_5_0#lib_fstorage_sd"&gt;&lt;code&gt;nrf_fstorage_sd&lt;/code&gt;&lt;/a&gt; is not yet available.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99117?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 14:56:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8138944-fd6e-4f0d-aea5-f5d5fb08c886</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Please try someone do the same way&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99107?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 13:47:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b999df53-a929-430c-86f3-f8fc6c5ee02e</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;I&amp;#39;ve just simplified an example. I take ble_app_uart example in sdk14, and add just two functions from &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/lib_fds_usage.html?cp=4_0_0_3_48_2_0#lib_fds_usage_init"&gt;infocenter example&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void fds_evt_handler(fds_evt_t const * p_fds_evt)
{
    switch (p_fds_evt-&amp;gt;id)
    {
        case FDS_EVT_INIT:
            if (p_fds_evt-&amp;gt;result != FDS_SUCCESS)
            {
                // Initialization failed.
            }
            break;
        default:
            break;
    }
}
    
ret_code_t fds_test_init (void)
{
		ret_code_t ret = fds_register(fds_evt_handler);
		if (ret != FDS_SUCCESS)
		{
					return ret;
		}
		ret = fds_init();
		if (ret != FDS_SUCCESS)
		{
				return ret;
		}
		
		return NRF_SUCCESS;
		
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in main function I call
&lt;code&gt;fds_test_init&lt;/code&gt; and again app stops working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99106?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 12:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a4d5d47-d41f-4056-b0b8-41de4264ca69</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;I tried but get nothing. I noticed one new thing... If I do double program it works (with second attempts), so if I erase, program sd, program app, program app again it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99101?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 10:40:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a43d5423-0533-49a0-8558-793c4ce5fc11</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Could you try following &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/?answer=60126#post-id-60126"&gt;this debug guide&lt;/a&gt;, to see if any other functions are returning non-zero error codes?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99100?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 07:36:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a110ae7d-7706-4632-8911-f9cfe646525f</guid><dc:creator>Stas</dc:creator><description>&lt;ol&gt;
&lt;li&gt;I don&amp;#39;t know what does it means &amp;quot;register properly&amp;quot;. I do it like in example code on &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/lib_fds_usage.html?cp=4_0_0_3_48_2_0#lib_fds_usage_init"&gt;infocenter of nordic&lt;/a&gt;.
As I think there are not any changes in this part between sdk13 and sdk14.&lt;/li&gt;
&lt;li&gt;I can&amp;#39;t find this function. But I guess it&amp;#39;s the same as should be,  because I&amp;#39;ve changed nothing in component folder files.&lt;/li&gt;
&lt;li&gt;After I step through raw &lt;code&gt;ret = fds_init();&lt;/code&gt;
the ret is 0 in watch window while debugging.&lt;/li&gt;
&lt;li&gt;I can&amp;#39;t check this value because my program as I think doen&amp;#39;t go into fds_evt_handler&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99113?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 07:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99fa330c-ff39-4f2d-b69e-578af3a82ca5</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;It does send an fds_evt_handler for all asynchronous calls (init, write, delete, update, gc).  Check&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You have registered your fds_evt_handler properly&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Your sys_evt_handler looks like this :&lt;/p&gt;
&lt;p&gt;static void sys_evt_dispatch(uint32_t sys_evt) {
fs_sys_event_handler(sys_evt);
ble_advertising_on_sys_evt(sys_evt);
}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Your return is 0 for the actual init call and 4. Your p_fds_evt-&amp;gt;result is 0 on the call back&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99105?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 07:00:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af4ee492-99ee-41b7-8f1e-d12eeac52c96</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;As I understand program doesn&amp;#39;t return any fds event handler because I try to set breakpoints on different raws inside fds_evt_handler function but the program doesn&amp;#39;t stop there. Also I&amp;#39;ve tried to add SEGGER function for detecting no works too.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void fds_evt_handler(fds_evt_t const * const p_fds_evt)
{
    switch (p_fds_evt-&amp;gt;id)
    {
			SEGGER_RTT_printf(0, &amp;quot;handler\n\r&amp;quot;);
        case FDS_EVT_INIT:
            if (p_fds_evt-&amp;gt;result != FDS_SUCCESS)
            {
							 SEGGER_RTT_printf(0, &amp;quot;failed\n\r&amp;quot;);
                // Initialization failed.
            }
            break;
				case FDS_EVT_WRITE:
						if (p_fds_evt-&amp;gt;result == FDS_SUCCESS)
						{
							write_flag=1;
						}
						break;
						
				case FDS_EVT_DEL_RECORD:
						if (p_fds_evt-&amp;gt;result == FDS_SUCCESS)
						{
							delete_flag=1;
						//	SEGGER_RTT_printf(0, &amp;quot;del\n\r&amp;quot;);
						}
						break;
        default:
            break;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99104?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 06:48:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c2dcd02-1e87-4817-864b-a0317fd5879e</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;Check your fds_evt_handler for error codes for &amp;quot;FDS_EVT_INIT&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99109?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 06:40:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:596d12c2-5f89-4027-9eae-e2a219e9cf26</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Yes. I do all the time by that way (eraseall, program softdevice, program app). There were not any problems with sdk13, but now...
There&amp;#39;s main function&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{
    bool erase_bonds;
		uint32_t err_code;
    // Initialize.
    log_init();
		SEGGER_RTT_printf(0, &amp;quot;start app\n\r&amp;quot;);

		m_clock_timer_init();
		pwm_init_corr();
		pwm_init_rgb();
	
		HX711_init();
		
		err_code = fds_test_init();
		APP_ERROR_CHECK(err_code);
		
	
	//fds_init_values();
	//fds_get_init_data();
		//test_expired();
		//fds_clear();  
	//	rgb_set(50, 50, 50, 3, 1500);
    timers_init();
    power_management_init();
    buttons_leds_init(&amp;amp;erase_bonds);
    ble_stack_init();
    peer_manager_init();
    gap_params_init();
    gatt_init();
    advertising_init();
    services_init();
    conn_params_init();

    //NRF_LOG_INFO(&amp;quot;Start scale driver app\n&amp;quot;);

    // Start execution.
    application_timers_start();
    advertising_start(erase_bonds);

    // Enter main loop.
    for (;;)
    {
        if (NRF_LOG_PROCESS() == false)
        {
            nrf_pwr_mgmt_run();
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I comment these raws:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//err_code = fds_test_init();
    //		APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;app starts work&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99103?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 05:58:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b20b9eda-9c75-404e-9916-d7c8ac9e7f7a</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;If it&amp;#39;s returning 0 that means success, so this is not where your issue is.  Be sure to fully erase the chip when re-programming since old FDS data is maintained and can cause issues if you changing your FDS implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99102?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 03:58:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f149007c-9456-4729-a7c5-55de943460b4</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;I forgat to change optimization level of debugging to level 0.
So now I can see that ret either returned by &lt;a href="http://ybex.com/d/55m3aksxg6e682ltsfhxwfaqftyeju2d4r8ozxox.html"&gt;fds_register&lt;/a&gt; or &lt;a href="http://ybex.com/d/3a2czjmtgjyy2w5yoby2nkojo60knyalk9ivlv7i.html"&gt;fds_init&lt;/a&gt; functions is 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99116?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 02:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f402f9db-23c4-44fe-92af-b5bfd2e46b6b</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried to get ret_code using function
SEGGER_RTT_printf(0, &amp;quot;%d&amp;quot;, ret_code);
but I get nothing in terminal if use fds_init function even if I to write any message before calling fds_init.
Also I&amp;#39;ve tried to get err_code via debugging (keil), I set breakpoint next to
ret_code_t ret = fds_register(fds_evt_handler);
but in watch window most of the time err_code&amp;#39;s value .
&lt;a href="http://ybex.com/d/923igmoumfiukx3fong1bg2xrg4wzpqg9m3qbeyi.html"&gt;screen&lt;/a&gt;
is there any guide how to get ret_code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99112?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 19:07:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2847cb62-e02b-4717-8b4e-bf0c88d50cee</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;It&amp;#39;s in ret, it&amp;#39;s a number.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99115?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 17:01:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9cd8c8e-7e20-4dba-b66a-a9b3cabc51b8</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Where I can find this code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99114?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 16:51:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e4431a9-8913-4772-9964-f89a95db079e</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;No, the error code returned by &amp;quot;ret&amp;quot;.  APP_ERROR_CHECK just enables a loop for debugging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99108?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 15:51:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ed40f38-4b9e-4695-879b-1a5c31ff6be1</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Actually I didn&amp;#39;t get any info in neither RTT terminal nor uart terminal. Do you mean error code that returned by APP_ERROR_CHECK ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fds in sdk14</title><link>https://devzone.nordicsemi.com/thread/99099?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 15:02:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f3d55c6-5484-4a79-b185-378046ccdb6f</guid><dc:creator>RichieJH</dc:creator><description>&lt;p&gt;What is your error code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>