<?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 error base num</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35424/fds-error-base-num</link><description>I am starting to use FDS for saving data to flash memory. In the &amp;quot;flash_fds&amp;quot; example the macro APP_ERROR_CHECK() is used to check for errors in most of the function calls, for example 
 
 and 
 
 I now tried using the same type of error handling in my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Nov 2018 12:48:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35424/fds-error-base-num" /><item><title>RE: FDS error base num</title><link>https://devzone.nordicsemi.com/thread/156494?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 12:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f224ee9-c90e-4e28-8771-d4e98ce83aba</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am happy to report that FDS errors will get a separate NRF_ERROR_FDS_ERR_BASE of 0x8600 in sdk_errors.h, for next release of the SDK.&lt;/p&gt;
&lt;p&gt;From then on, &amp;quot;FDS_ERR_OPERATION_TIMEOUT = NRF_ERROR_FDS_ERR_BASE&amp;quot; in the definition of FDS return values in fds.h, and there is no longer any overlapping error codes.&lt;/p&gt;
&lt;p&gt;Thank you to everyone who have reported this. Your reports are crucial for identifying and fixing issues like this one.&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: FDS error base num</title><link>https://devzone.nordicsemi.com/thread/156381?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 19:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b7fa785-4215-4321-a15c-fbf58f1e1761</guid><dc:creator>dare</dc:creator><description>&lt;p&gt;I too have run into this problem.&amp;nbsp; Although in my case I was trying to develop a consistent way to return errors in a library that wraps FDS.&lt;/p&gt;
&lt;p&gt;The lack of consistent error representation in the nRF SDK is a significant liability, IMO, and promotes bugs that could have significant consequences in mission critical applications where checking and handling errors is extremely important.&lt;/p&gt;
&lt;p&gt;In the case of the FDS API this is particularly &lt;span class="vmod"&gt;pernicious because no where in the documentation does it warn developers that FDS_ERR_* values are ambiguous with other errors.&amp;nbsp; This is true despite the fact that the FDS APIs use ret_code_t, suggesting a uniform error space.&amp;nbsp; This just seems to be inviting confusion.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I definitely think that Nordic needs to prioritize making their APIs more robust and consistent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS error base num</title><link>https://devzone.nordicsemi.com/thread/149974?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 09:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ef73665-4879-4b79-b2c7-a3b2aa36592b</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is rather a workaround within Peer Manager, where now the Peer Manager event structures (&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fstructpm__evt__t.html"&gt;pm_evt_t&lt;/a&gt;), some of which return error events of type &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fstructpm__failure__evt__t.html"&gt;pm_failure_evt_t&lt;/a&gt;, those events now have a bool fds_error which tells you if the address space of the contained error is in FDS_*.&lt;/p&gt;
&lt;p&gt;The overall error address space issue is not solved, so this will only tell you how to interpret error codes relayed through the Peer Manager event system. You still need to know how to interpret those error codes differently, depending on whether it is an FDS_ or an NRF_ error.&lt;/p&gt;
&lt;p&gt;I will push some more on moving the FDS_ errors to their own number range.&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: FDS error base num</title><link>https://devzone.nordicsemi.com/thread/149868?ContentTypeID=1</link><pubDate>Fri, 21 Sep 2018 14:57:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:158def9b-a96b-4775-aefe-20ca0205898f</guid><dc:creator>gnf</dc:creator><description>&lt;p&gt;Three months later I fell into this trap again... I tried implementing the FDS_ERROR_CHECK custom macro but apparently I did something wrong so that didn&amp;#39;t work. Will have to fix that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyway, I saw an interesting note in the release notes of SDK 15.2 (that I just upgraded to), about Peer Manager:&lt;/p&gt;
&lt;p&gt;&amp;quot;Error event parameters now specify whether the error code is to be interpreted as an FDS_ error or an NRF_ error.&amp;quot;&lt;br /&gt;&lt;br /&gt;Is this the same issue, solved somehow inside Peer Manager, or what does it mean? I am just curious to see if Peer Manager has solved it in some other way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS error base num</title><link>https://devzone.nordicsemi.com/thread/136219?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 15:27:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbd56ff6-d790-4620-84f2-f2a5b7ad819f</guid><dc:creator>gnf</dc:creator><description>&lt;p&gt;Ok, thanks for the fast response. I guess I will go for the FDS_ERROR_CHECK custom macro for the FDS API calls to see how that would work in my code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, you are right that I am trying to&amp;nbsp;print as much information about the error as possible. I am using the&amp;nbsp;nrf_strerror_get() function for printing out the name of some common errors. That&amp;#39;s really useful when debugging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS error base num</title><link>https://devzone.nordicsemi.com/thread/136214?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 14:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db58bf20-4e17-4fd8-bf35-a1ad22bebedc</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for reporting this and for the suggestion. I will forward the suggestion to the SDK team, maybe they will come up with a solution for a later SDK release, where error codes are not overlapping.&lt;/p&gt;
&lt;p&gt;Do I understand correctly that you want to print the textual representation of the error code in your error handler? I.e. programmatically decide which error to report? I can think of two ways to do that (although there are probably more):&lt;/p&gt;
&lt;p&gt;First option, use two separate error check macros (APP_ERROR_CHECK for other SDK API calls, and a custom one for instance named FDS_ERROR_CHECK for FDS API calls,)&lt;/p&gt;
&lt;p&gt;Second option, change the definition of the enum in fds.h so that FDS_SUCCESS is still 0 but FDS_ERR_OPERATION_TIMEOUT which is the next FDS error code starts at an offset.&lt;/p&gt;
&lt;p&gt;The above options have pros and cons, so it all depends on what tradeoff you are willing to do. Separate macros for checking the error opens the door for inadvertently using the wrong macro thus getting an erroneous error message. Changing the library means you must do the same change if porting to a later SDK release, and also always make sure to link only to versions of the FDS library where this change is in place.&lt;/p&gt;
&lt;p&gt;Perhaps others have other suggestions, or suggestions for how to mitigate drawbacks of the options outlined above?&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></channel></rss>