<?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>sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40088/sd_flash_write-cause-nrf_fault_id_sd_assert</link><description>Hi, 
 I have run into an issue with nrf52840 on pca10056 v1.0.0 board. The softdevice is SD v6.1.0. It seems to be a hardfault which cause a reset when I tried to call sd_flash_write(), sd_flash_page_erase() is OK though. The address and buffer is 4 byte</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Apr 2020 12:41:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40088/sd_flash_write-cause-nrf_fault_id_sd_assert" /><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/245533?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 12:41:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15cdf162-2b8e-4703-a84c-4e1bb8b423da</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am glad to hear you fixed the issue, but I would not trust it as a stable fix. Using a different clock source will, of course, affect timing slightly, and in this case apparently for the better (It seems like the LFRC clock is a bit slower than the LFXO clock in this case). But in this case, the fix is marginal and likely to be affected by the chip to chip differences in the LFRC performance.&lt;/p&gt;
&lt;p&gt;The only workaround is to update the SoftDevice version to &amp;gt;= 7.0.1, since the issue is with a hard-coded constant within the SoftDevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/245412?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 04:42:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a781c484-5f15-4ffc-bd08-aba9306204c4</guid><dc:creator>Jake Yun</dc:creator><description>&lt;p&gt;&lt;span&gt;By the way, in my case, to change LF clock source to LFRC from LFXO seems to resolve the problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please let me know the mechanism behind the issue to find another way for the problem.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/245325?ContentTypeID=1</link><pubDate>Sat, 18 Apr 2020 01:46:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e57ccef-ea6b-4423-b9e5-927f46b213f3</guid><dc:creator>Jake Yun</dc:creator><description>&lt;p&gt;OK, I see.&lt;/p&gt;
&lt;p&gt;Thank you for the advice.&lt;/p&gt;
&lt;p&gt;Have a nice weekend.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/245292?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 15:16:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82d82bcb-8e55-418d-ad3f-66105a9f249a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think you should see the x.0.0 as an indication of a lack of quality in the nRF5 SDK context. It has stabilized over the years, and the recent/current policy is to increase the SDK major version number when&amp;nbsp;it is designed to be used with a different SoftDevice major version. So you can assume that the next nRF5 SDK version will be 17.0.0, though I cannot say that for sure. I recommend you contact sales if you need details about the schedule.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/245284?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 15:00:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:057f9bd5-49a2-488c-ba5e-dff07af7e9e1</guid><dc:creator>Jake Yun</dc:creator><description>&lt;p&gt;That would be an option but 7.0.1 is supported only by SDK 16,0,0 not by 15.3.0 which I&amp;#39;m using.&lt;/p&gt;
&lt;p&gt;In fact, I am not comfortable with x.0.0 versions.&lt;/p&gt;
&lt;p&gt;SDK 16.1.0 may come to us soon, isn&amp;#39;t it?&lt;/p&gt;
&lt;p&gt;It&amp;#39;s been half an year since 16.0.0 is released. :-)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/245272?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 14:23:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f3d7d8e-fadf-4b8b-9f7f-1a81016d0dff</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Is updating to 7.0.1 an option? If so, then that would be the natural way to fix this issue (assuming this really is the issue you are seeing).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/244933?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 10:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27ac94f2-5187-480f-adc1-3822ef3aeaac</guid><dc:creator>Jake Yun</dc:creator><description>&lt;p&gt;Ok, I got it.&lt;/p&gt;
&lt;p&gt;Then, my issue must come from&amp;nbsp;&amp;quot;sd_flash_page_erase()&amp;quot; because my buffer size is only 128 words (512 bytes).&lt;/p&gt;
&lt;p&gt;In my case, to change LF clock source to LFRC from LFXO alleviates the problem but I don&amp;#39;t know how it affects. Of cource, LF clock has relation with the scheduler of softdevice.&lt;/p&gt;
&lt;p&gt;but I don&amp;#39;t like to change the clock source to LFRC.&lt;/p&gt;
&lt;p&gt;Do you know any other workaround for the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/244918?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 10:03:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bf949be-6261-462e-8755-11953a2b5e90</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;1. Yes.&lt;/p&gt;
&lt;p&gt;2. No.&amp;nbsp;sd_flash_write() with large words are not safe. The safe buffer length depends on the location of the source buffer (flash or RAM). Based on the tests we have done, 512 words are always safe. In practice, the limit seems to be about ~800 words if the source buffer is in RAM, but I cannot guarantee an exact number.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/244830?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 00:36:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9acc14b6-62e5-4b9c-9a47-21f5a8602eec</guid><dc:creator>Jake Yun</dc:creator><description>&lt;p&gt;Thank you for the prompt reply, Einar.&lt;/p&gt;
&lt;p&gt;Please confirm if my understanding is right.&lt;/p&gt;
&lt;p&gt;1. SD before 7.0.1 (such as SD 6.1.1) may raise &amp;quot;NRF_FAULT_ID_SD_ASSERT&amp;quot; on &amp;quot;sd_flash_page_erase()&amp;quot;&lt;/p&gt;
&lt;p&gt;2. &amp;quot;sd_flash_write()&amp;quot; is safe on all SD versions(e.g. 6.1.1, 7.0.1) as long as the buffer size is less than 1024 words.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/244781?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 14:54:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1527f7e4-5433-4a89-a745-cfcfc10a0cc4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. This is not the exact same issue as&amp;nbsp;DRGN-12539. The fix there in 7.0.1 is for erase operations only, not for write operations.&lt;/p&gt;
&lt;p&gt;2. This is a fixed number that is calculated beforehand and hardcoded in the SoftDevice, and the timeout is supposed to be set to after the maximum write duration. But the bug discussed in this thread is because this timeout is set too low.&lt;/p&gt;
&lt;p&gt;3. It is not fixed in 7.0.1. It will most likely be fixed in the next major SoftDevice release, but I cannot promise anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/244576?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 02:41:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5471958-7cfb-4d11-b3aa-fecf1f78b29f</guid><dc:creator>Jake Yun</dc:creator><description>&lt;p&gt;Hi, Einar.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m suffering from this issue too though my buffer size is 512(bytes).&lt;/p&gt;
&lt;p&gt;1. Does &amp;quot;DRGN-12539&amp;quot; affect only &amp;quot;&lt;span&gt;LARGE buffers&amp;quot;?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m suspecting that the time scheduled for &amp;quot;sd_flash_write(p_dst, p_src, size)&amp;quot; is calculated according to the &amp;quot;size&amp;quot; in its arguments. Isn&amp;#39;t it?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If so, the real time spent can be larger than expected(calculated) irrespective of size(i.e. buffer is LARGE or not).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Please let me know the detailed mechanism which softdevice is using to estimate the required time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. If this issue is not reliable fixed even in 7.0.1 and will be fixed in next MAJOR version, would it be 8.x?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/228561?ContentTypeID=1</link><pubDate>Fri, 10 Jan 2020 12:37:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d5f9333-3829-4955-8d3d-2eb7c9b470cb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The statements you refer to relate to updates that have also impacted the issue with writing large buffers to nRF52840,&amp;nbsp;but you should not assume that the issue is reliably fixed. The next major version of S140 will incorporate a proper fix.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/228403?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2020 15:23:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2be3ce7b-f7a5-4fbb-8533-7534dd21529c</guid><dc:creator>Dan Halbert</dc:creator><description>&lt;p&gt;Hi, following up, has this been fixed in 7.0.x? In the 7.0.0 Release Notes, I see:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The time scheduled for a flash write or flash page erase using sd_flash_write or sd_flash_page_erase APIs on nRF52811 will be longer than required and the same as for nRF52832.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And in 7.0.1, I see:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Fixed an issue where the time scheduled for a flash write or flash page erase using sd_flash_write or sd_flash_page_erase APIs on nRF52811 will be longer than required and the same&amp;nbsp;&lt;/em&gt;&lt;em&gt;as for nRF52832 (DRGN-12539)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Perhaps is this implying the scheduled time was lengthened in 7.0.0 to allow a full page write (and made more precise in 7.0.1), but that would be a guess.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/182706?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2019 06:00:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5115868-97d6-4008-8138-463bb16fa1fd</guid><dc:creator>Nandi</dc:creator><description>&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span class="" title=""&gt;thank you for your reply, According to the way you said, it can be solved. I have another problem here. I use the internal Flash to make a U disk. I can&amp;#39;t call the flash write function in the usb interrupt and it will timeout.&amp;nbsp; It has been resolved when I use polling in usb intterupt .&amp;nbsp; thank&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/182230?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2019 05:48:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:384e4898-c09f-46d6-8c3c-712c9b03056c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/nandi"&gt;Nandi&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;The problem is that long writes takes longer time than what has been allocated to the flash write by the internal scheduler in the SoftDevice. Splitting long writes into multiple shorter once should be an acceptable workaround in most case. There is nothing else you need to consider, other than things like not accessing the NVMC directly when using the SoftDevice, but that is unrelated to this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/182138?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 13:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:248f82ca-79e7-4c1b-9abe-bcf2252b99f5</guid><dc:creator>Nandi</dc:creator><description>&lt;p&gt;&lt;span class="tlid-translation translation" lang="en"&gt;&lt;span title=""&gt;I also found the same issue, using s340 6.1.1.&lt;/span&gt; &lt;span title=""&gt;What do I have to do to use flash when enabling softdevice?&lt;/span&gt; &lt;span title=""&gt;This is a very serious issue for the products we are developing.&lt;/span&gt; &lt;span title=""&gt;The current product cannot continue to do so.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/156685?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 13:54:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c03f76b2-f2ae-4fc7-bdbe-08aedfac29e0</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;It is not fixed in 6.1.1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/156667?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 12:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e93bcb41-674e-45bd-a053-cf2f906e4a9a</guid><dc:creator>hathach</dc:creator><description>&lt;p&gt;Just saw the 6.1.1 release, any chances that this is fixed. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/155874?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 08:29:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c67cc5f-9059-4e7b-886d-a50c67145670</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;That sounds good. I have created an internal bug report so that it can be fixed in a future SoftDevice release.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/155809?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 16:42:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7756f6fc-5e76-44cc-bbf7-563f700dfffc</guid><dc:creator>hathach</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;Thanks, I am glad that you could reproduce it. Was thinking it is my code doing incorrectly. Please take your time, I divide it into 2 writes ( half page each) as walkaround, seems to be OK for now.&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;&lt;a href="https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/develop/cores/nRF5/flash/flash_nrf5x.c#L146"&gt;github.com/.../flash_nrf5x.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/155791?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 14:47:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5caf9a8e-a74b-4566-83fd-0740e4ac0d92</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see this on my side as well. The assert indicate that the SoftDevice spends too much time writing to flash. I am not&amp;nbsp;sure why though, as the API documentation states that&amp;nbsp;the maximum number of words is 1024 (number of words in one flash page). I will look more into it and hopefully&amp;nbsp;have more info on Monday.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_flash_write() cause NRF_FAULT_ID_SD_ASSERT</title><link>https://devzone.nordicsemi.com/thread/155752?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 12:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3e1fd1e-36a3-4d4e-b361-3588c9dd4ddb</guid><dc:creator>hathach</dc:creator><description>&lt;p&gt;&lt;span style="background-color:#ffffff;color:#000000;float:none;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;new found, if I seperate the whole page write (1024 words) into 2 x 512 words, it does seems to work. This is a workable walk-around, but I am still interested on why S140 v6.1.0 assert, it should be able to handle up to a page write according to the specs. hmmm. Did I miss something !!!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>