<?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 not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29137/fds-not-able-to-write-in-sdk-14</link><description>Dear all, 
 I&amp;#39;m struggling writing 32 bytes with FDS in SDK 14. 
 This is what I do: 
 Init 
 (void) fds_register(fds_evt_handler);
fds_init();
while(!is_init) {
 sd_app_evt_wait();
}
 
 Write 
 fds_record_t record;
fds_record_desc_t record_desc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Dec 2018 18:54:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29137/fds-not-able-to-write-in-sdk-14" /><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/163091?ContentTypeID=1</link><pubDate>Thu, 27 Dec 2018 18:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e737f058-2917-4d40-aba7-36f0794e7af4</guid><dc:creator>arthare</dc:creator><description>&lt;p&gt;Chris&amp;#39;s and Jukka&amp;#39;s answer&amp;nbsp;fixed me!&amp;nbsp; I just want to add my symptoms so this might come up earlier in searches:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An application run would either never get its&amp;nbsp;&lt;span&gt;FDS_EVT_INIT callback or would get it immediately.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Each time I started my application, my FDS pages (m_pages in fds.c) would be one state closer to inited.&amp;nbsp; So I could start-&amp;gt;stop-&amp;gt;start-&amp;gt;stop-&amp;gt;start-&amp;gt;stop, and eventually they&amp;#39;d hit the `ALREADY_INSTALLED` return in fds_init(), which would get me my `FDS_EVT_INIT` callback and my app would start.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The fact the pages changed each time I started the app seemed to show that the writes were _happening_, just that some callbacks weren&amp;#39;t happening&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Further debugging in&amp;nbsp;`nrf_fstorage_sd.c` (fstorage&amp;#39;s softdevice implementation) seemed to show that it never got its `nrf_fstorage_sys_evt_handler` callback, which&amp;nbsp;seemed likely to be needed&amp;nbsp;in order for FDS to eventually get the callback it needed.&amp;nbsp;&amp;nbsp;Since `nrf_fstorage_sys_evt_handler` is registered with `NRF_SDH_SOC_OBSERVER`, that&amp;#39;s what got me on the scent of nrf_sdh_soc, and what led me to this answer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Fixed for me just by adding nrf_sdh_soc.c to my makefile - I didn&amp;#39;t have to add a stub, but I also don&amp;#39;t have any optimizations on.&amp;nbsp; I had missed&amp;nbsp;adding it to my makefile while migrating from SDK 11.0.&amp;nbsp; Now I&amp;#39;m worried there&amp;#39;s other files I&amp;#39;ve missed...&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using Softdevice S332 5.0.0, API 14.2 (17b948a)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/155651?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 18:57:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bd7f855-e758-48de-a650-0e2bdd8c6b7d</guid><dc:creator>Shawn N.</dc:creator><description>&lt;p&gt;I uploaded a hacked up ble_app_beacon (for PCA10040) example here:&lt;a href="https://drive.google.com/open?id=1wk3kneAHq2x-fu3SpNUjovHQtUIVGJLo"&gt; https://drive.google.com/open?id=1wk3kneAHq2x-fu3SpNUjovHQtUIVGJLo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can build it with a command similar to: &lt;pre class="ui-code" data-mode="text"&gt;mkdir build &amp;amp;&amp;amp; cd build
cmake -DNRF_SDK=$HOME/devel/nrf5-sdk/15.2.0/ -DCMAKE_TOOLCHAIN_FILE=../NRF52832.cmake ..&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the initial state, it works due to the &lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_sdk_soc_dont_kill_init();&lt;/pre&gt; at line 315 of main.c (you must also add the empty function definition to the nrf_sdh_soc.c file).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you comment out this line, the example fails. LED4 stops blinking eventually due to a CANCELLED or BLOCKED timeslot and the event handler never runs requesting another.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Leaving that line commented out and commenting out line 171 of CMakeLists.txt and modifying line 173 to read &lt;pre class="ui-code" data-mode="text"&gt;add_executable(${PROJECT_NAME}.elf ${SRC} ${NRF_SDK}/components/softdevice/common/nrf_sdh_soc.c)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Makes it work again by directly linking against the application&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/155649?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 18:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:629262a0-1b2c-4416-8620-93c42bbe2791</guid><dc:creator>Shawn N.</dc:creator><description>&lt;p style="color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;margin-top:0px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;"&gt;I am seeing this problem here (needs a dummy init function to function as intended). I am using arm embedded gcc 6-2017-q2 with sdk 15.2.0.&lt;/p&gt;
&lt;p style="color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;"&gt;I was linking all the Nordic SDK files into a static library and then using that library in the final linking step with my executable.&lt;/p&gt;
&lt;p style="color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;"&gt;When nrf_sdk_soc.c was linked into the static library, it only worked when I added the dummy init to the main.c compilation unit.&lt;/p&gt;
&lt;p style="color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;"&gt;When I linked nrf_sdh_soc.c directly against the executable (all other nordic file still in the static library), it worked without using the dummy init hack.&lt;/p&gt;
&lt;p style="color:#000000;font-family:Arial, Helvetica, sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;"&gt;It must be something about visibility of the event handler to the nrf_sdh_soc.c during linking?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/155408?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 16:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:469a08d8-7c3e-4e98-94ce-cfbbd14c080c</guid><dc:creator>Anne van Rossum</dc:creator><description>&lt;p&gt;Why is this file actually required? What does it do? In the code I see the following:&lt;br /&gt;&lt;br /&gt;* registering for logging&lt;br /&gt;* registering nrf_sdh_soc_evts_poll as a NRF_SDH_STACK_OBSERVER, is this to forward stack events to the SOC observers?&lt;br /&gt;* a section definition, wasn&amp;#39;t this already done using the linker actually (this is just my ignorance)?&lt;br /&gt;* in the poll function itself it forwards stuff to the SOC observers and prints the events&lt;br /&gt;&lt;br /&gt;Correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/155400?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 15:42:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c099f498-fdbf-45f8-8346-29b4ad1a695e</guid><dc:creator>Anne van Rossum</dc:creator><description>&lt;p&gt;I also encountered this. Nice catch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/115754?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2018 07:33:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be0003f5-f6e4-4ecd-a04e-491009d20d20</guid><dc:creator>Jukka Saari</dc:creator><description>&lt;p&gt;I had the same problem with SDK 14.1. For me it was enough to add &lt;strong&gt;nrf_sdh_soc.c&lt;/strong&gt; to sources in Makefile. I guess the bug is that you don&amp;#39;t get any error if it is missing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/115758?ContentTypeID=1</link><pubDate>Thu, 14 Dec 2017 11:39:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1044ffc9-3632-46b8-86f6-b2665b73ba25</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Sounds like a bug, I need to look into it. Could you upload your complete project so I can try to reproduce here? Which toolchain are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/115757?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 08:49:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c396bc6-210e-43af-af69-de9699474bd8</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Sure!
Is this considered a bug which will be fixed or is it intended by design?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/115756?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 12:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a74faf5-8a9b-42d2-83fb-b4d0d21b1379</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Thanks for adding an answer :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS not able to write in SDK 14</title><link>https://devzone.nordicsemi.com/thread/115755?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 11:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4750037d-8237-4428-8b1b-e18fdf170e25</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;alright, it seems like nrf-sdh_soc.c gets killed by optimization.
I fixed that by adding a blank nrf_sdh_soc_init and call it from my main.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>