<?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 with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97082/fds-with-softdevice-reporting-fds_err_crc_check_failed-on-read</link><description>Hi, 
 I&amp;#39;m using SEGGER Embedded Studio to write code that writes BLE characteristics to flash storage (via FDS) when they&amp;#39;re changed. When the device starts up after a reset, it will read these characteristics from FDS during initialization. 
 I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Mar 2023 09:13:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97082/fds-with-softdevice-reporting-fds_err_crc_check_failed-on-read" /><item><title>RE: FDS with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/thread/413180?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2023 09:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:484ef25e-c4da-4af9-a2b6-930d093dd1ec</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="ellamoss"]This led me back to my event handler, where I APP_ERROR_CHECK(p_fds_evt-&amp;gt;result). This result is 0x8609, FDS_ERR_NOT_FOUND.[/quote]
&lt;p&gt;And the event ID &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__fds.html#ga9374d0e6608b9b07940401b407617f8d"&gt;fds_evt_id_t &lt;/a&gt;id for that p_fds_evt was a &lt;em&gt;FDS_EVT_UPDATE?&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="ellamoss"]Do you know why fds_record_update would lead to this error? Immediately before calling flash_update, I verify that the key exists by calling my flash_read function, which returns 0 (meaning the file exists - right?).[/quote]
&lt;p&gt;If fds_record_open() returns 0 then the record has been found in the fds module.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you try do it in one function as in the fds example? I suspect that the there is some scope issue in that the descriptor isn&amp;#39;t set correctly between the two function calls.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/thread/413133?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 22:40:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff3b80b2-fc1c-42d5-8d0c-9646dda232d8</guid><dc:creator>ellamoss</dc:creator><description>&lt;p&gt;That makes sense. When I open it up in the debugger, I put a print statement after that fds_record_update call but I don&amp;#39;t hit it - it jumps to app_error_weak.c, and that&amp;#39;s where I see the NRF_FAULT_ID_SDK_ERROR code.&lt;/p&gt;
&lt;p&gt;So as far as I can tell, this is triggered by write_enqueue in fds.c. I put in a bunch of print statements (pausing with the debugger always yields an exception, as you mentioned), and found the culprit to be the queue_start() command in write_enqueue, in fds.c.&lt;/p&gt;
&lt;p&gt;So I stepped into that function, used print statements again to determine it came from event_send(&amp;amp;evt).&lt;/p&gt;
&lt;p&gt;This led me back to my event handler, where I APP_ERROR_CHECK(p_fds_evt-&amp;gt;result). This result is 0x8609, FDS_ERR_NOT_FOUND.&lt;/p&gt;
&lt;p&gt;Do you know why fds_record_update would lead to this error? Immediately before calling flash_update, I verify that the key exists by calling my flash_read function, which returns 0 (meaning the file exists - right?).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/thread/412902?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2023 07:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9d8c66c-0a40-484a-8a99-b9cde5677a71</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;This is the return values from fds_record_update:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1677743616102v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;none of them correspond to&amp;nbsp;&lt;span&gt;NRF_FAULT_ID_SDK_ERROR.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note that trying to halt the CPU by pausing it with the debugger will always result in a exception when it&amp;#39;s resumed, if the application is using the softdevice.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you share a screenshot that shows the return value from fds_record_update()?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/thread/412829?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 18:48:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:292e67a3-e164-4747-851a-00e9efc92170</guid><dc:creator>ellamoss</dc:creator><description>&lt;p&gt;Okay, I think I&amp;#39;m getting closer. But now when I try to do a flash_update (ie, fds_record_update in the first code block), it errors out to the app_error_fault handler. I&amp;#39;m getting an error code 0x4001, which seems to correspond to &amp;quot;NRF_FAULT_ID_SDK_ERROR&amp;quot;. Do you know why this might be happening, or how I can troubleshoot it?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Ella&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/thread/412445?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 09:43:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b63b7a7f-e1dd-4a7b-a5bb-4845478b5f72</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, that is exactly how I would implement it.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/thread/412371?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 22:43:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a59971f0-f6f8-45c6-aaea-e34053ff471b</guid><dc:creator>ellamoss</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The error happens during calls to flash_read; from there, it seems to be coming from a call to fds_record_open() (line 137 of my first code block). So do I need to write code to wait on reads until I get the FDS_EVT_WRITE event? Maybe a volatile flag that I wait for being set before doing any reads?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Ella&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FDS with SoftDevice reporting FDS_ERR_CRC_CHECK_FAILED on read</title><link>https://devzone.nordicsemi.com/thread/412304?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 14:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55e3ebeb-40d1-4ebb-8dba-1cf71d3455a0</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Exactly which FDS function is returning&amp;nbsp;&lt;span&gt;FDS_ERR_CRC_CHECK_FAILED?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Typical reason for getting&amp;nbsp;FDS_ERR_CRC_CHECK_FAILED&amp;nbsp;is trying to read the record before the fds module has completed writing&amp;nbsp;it and returned with&amp;nbsp;&lt;em&gt;FDS_EVT_WRITE.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>