<?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>freertos + fds</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38648/freertos-fds</link><description>Hi. I am trying to add FDS to my application where I used freertos and ble. I tried few things always ending with hardfault, one time it was from Freertos scheduler and the other times I cannot really tell. 
 - first I was trying to simply add fds_record_write</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Apr 2019 08:58:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38648/freertos-fds" /><item><title>RE: freertos + fds</title><link>https://devzone.nordicsemi.com/thread/182299?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2019 08:58:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f48be646-0ee4-44b0-b97e-0221f67e1ff3</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;for @Kosmine and any other:&lt;br /&gt;In my case problem was that when opening existing record I was using local variable `record` and didnt copy it to my global one. So there was no error just a mistake in programming. I advise you to double check flow of your application and maybe try to debug and see what values are available in `record` after callig `fds_record_open`. Regards !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: freertos + fds</title><link>https://devzone.nordicsemi.com/thread/182273?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2019 07:47:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:043a7f17-315b-4932-b6ac-e3daee74c093</guid><dc:creator>Kosmine</dc:creator><description>&lt;p&gt;I have similar problems on the very same setup. I can also confirm that the fds_record_write() returns FDS_SUCCESS and it never really finishes writing anything. However, When I dump the flash afterwards,&amp;nbsp; you can see below that it writes my word size (15) and record key (0x0C13), but not the actual data (i ran it three times, hence the 3 &amp;quot;dirty&amp;quot; records). I have no idea why this happens. When i take the fds_record_write() out of the FreeRTOS task function by running it before vTaskStartScheduler() it works perfectly.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;0x000FDFE0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FDFF0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE000: DEADC0DE F11E01FE 000F0C13 FFFFFFFF   |................|
0x000FE010: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE020: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE030: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE040: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE050: 000F0C13 FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE060: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE070: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE080: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE090: FFFFFFFF FFFFFFFF 000F0C13 FFFFFFFF   |................|
0x000FE0A0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE0B0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE0C0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE0D0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE0E0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
0x000FE0F0: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF   |................|
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: freertos + fds</title><link>https://devzone.nordicsemi.com/thread/149458?ContentTypeID=1</link><pubDate>Wed, 19 Sep 2018 13:13:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a826a42-d72a-4a7b-81fd-d7a9d185c560</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You might get into problems with interrupt context depending on how you write your code. For instance, you cannot wait inside higher interrupt level for the FDS event coming on a lower interrupt level. But in the general case calling FDS APIs from interrupt context should not be an issue, at least not as I am aware of.&lt;/p&gt;
&lt;p&gt;When using FreeRTOS and SoftDevice, make sure to define SOFTDEVICE_PRESENT. If not then that might explain strange behavior such as hardfaults and asserts.&lt;/p&gt;
&lt;p&gt;Initializing FDS even though peer manager has already done the same should not be a problem, ref. &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Flib_fds_usage.html"&gt;Flash Data Storage Usage&lt;/a&gt; documentation: &amp;quot;In the Peer Manager, fds_init is part of the initialization function pm_init. The module can be initialized multiple times, with no side effects.&amp;quot;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: freertos + fds</title><link>https://devzone.nordicsemi.com/thread/149318?ContentTypeID=1</link><pubDate>Tue, 18 Sep 2018 18:36:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db0f72a2-eba8-4d20-9663-7641b8890b13</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;It looks like problem is with writing data to flash from interrupt context. All of 3 attempts I was trying to use fds_record_write() from either gpio interrupt or freertos timer interrupt. However I did not find any documentation that would confirm this.&lt;/p&gt;
&lt;p&gt;I tried using it from main context and works ok.&lt;/p&gt;
&lt;p&gt;It would be nice if someone can confirm this and either fix documentation or show me where in documentation it is said that function cannot be used from interrupt context.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>