<?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>Softdevice fault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39941/softdevice-fault</link><description>Hello, 
 I am developing product on nrf52 with sd s112_nrf52810_5.1.0_softdevice. My application caused unexpected sd fault at adress 0x000089B2. I expect it to be something related to flash. What I did was call sd flash write function with some data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Feb 2019 07:01:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39941/softdevice-fault" /><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/172223?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 07:01:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c4d9cb-e19d-43d2-bc98-2c818fbe930c</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Michal managed to fix this issue. I would like to share with you our findings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It looks like workaround from MDK for Errata 36 does not cover all corner cases.&lt;/p&gt;
&lt;p&gt;Our&amp;nbsp;hypothesis:&amp;nbsp;Calibration is not&amp;nbsp;terminated by reset.&lt;/p&gt;
&lt;p&gt;We extended system_nrf52.c with this code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
void SystemInit(void)
{
 (...)
    /* Workaround for Errata 36 &amp;quot;CLOCK: Some registers are not reset when expected&amp;quot; found at the Errata document
       for your device located at https://infocenter.nordicsemi.com/  */
    if (errata_36()){
        NRF_CLOCK-&amp;gt;EVENTS_DONE = 0;
        NRF_CLOCK-&amp;gt;EVENTS_CTTO = 0;
        NRF_CLOCK-&amp;gt;CTIV = 0;
    }

    lfclk_calibrate();
 (...)
}
 

static void lfclk_calibrate(void)
{
    // Turn on HFCLK XTAL
    NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)
    {
    }

    // Start LFCLK (32kHz) RC oscillator.
    NRF_CLOCK-&amp;gt;LFCLKSRC = CLOCK_LFCLKSRC_SRC_RC &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos;
    NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED =0;
    NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART = 1;
    while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0);
    NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;

    // Calibrate
    NRF_CLOCK-&amp;gt;EVENTS_DONE = 0;
    NRF_CLOCK-&amp;gt;TASKS_CAL = 1;
    while (NRF_CLOCK-&amp;gt;EVENTS_DONE == 0)
    {
    }
    // Turn off HFCLK XTAL
    NRF_CLOCK-&amp;gt;TASKS_HFCLKSTOP = 1;

    // Turn off LFCLK
    NRF_CLOCK-&amp;gt;TASKS_LFCLKSTOP = 1;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This solved this problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155893?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 09:51:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7aae8ef6-360c-4f6c-a49a-7c14a4973f9f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;&amp;quot;&lt;span&gt;I see that you are using&amp;nbsp;SDK_NRF_SDH_CLOCK_LF_XTAL_ACCURACY set to 0( 250ppm). The internal LF clock on the nRF52810/nnRF52832 is 500ppm. So let&amp;#39;s try to set SDK_NRF_SDH_CLOCK_LF_XTAL_ACCURACY to 1 (500) ppm, and see if that solves the issue.&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155709?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 09:45:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d060923a-882d-4dc2-8877-4928bfcaad12</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;H,&lt;/p&gt;
&lt;pre&gt;set(&lt;span&gt;SDK_NRF_SDH_CLOCK_LF_RC_CTIV           16 CACHE STRING &lt;/span&gt;&amp;quot;&amp;quot;)&lt;br /&gt;set(&lt;span&gt;SDK_NRF_SDH_CLOCK_LF_RC_TEMP_CTIV       2 CACHE STRING &lt;/span&gt;&amp;quot;&amp;quot;)&lt;br /&gt;set(&lt;span&gt;SDK_NRF_SDH_CLOCK_LF_SRC                0 CACHE STRING &lt;/span&gt;&amp;quot;&amp;quot;)&lt;br /&gt;set(&lt;span&gt;SDK_NRF_SDH_CLOCK_LF_XTAL_ACCURACY      0 CACHE STRING &lt;/span&gt;&amp;quot;&amp;quot;)&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Yes, it is always the same address.&lt;br /&gt;&lt;br /&gt;I am using fds, I reserved 5 pages (they are placed before bootloader).&lt;br /&gt;&lt;br /&gt;I dont think it would be possible as source is confidential.&lt;br /&gt;&lt;br /&gt;Today I took one of devices after tests and attached debug session. Turns out for some reason after random number of tests (write to flash + power off) softdevice starts to return NRF_ERROR_INVALID_STATE when calling:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;sd_softdevice_enable&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It is weird as I dont think softdevice is using any flash so it should at least fix after power cycle but it doesnt. I checked flash content against binary but neither softdevice nor application were overwritten.&lt;/p&gt;
&lt;p&gt;EDIT: The above error was caused by some problem with debugger, it is not a real case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155406?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 16:08:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61e78a11-746b-45fc-8b49-018045654492</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What is the value of&amp;nbsp;NRF_SDH_CLOCK_LF_SRC,&amp;nbsp;NRF_SDH_CLOCK_LF_RC_CTIV,&amp;nbsp;NRF_SDH_CLOCK_LF_RC_TEMP_CTIV and&amp;nbsp;NRF_SDH_CLOCK_LF_ACCURACY , found in sdk_config.h ?&lt;/p&gt;
&lt;p&gt;Is it always the same assert code(&lt;span&gt;0x000089B2&lt;/span&gt;) ?&lt;/p&gt;
&lt;p&gt;Where in the flash are you writing values to with the sd flash write function?&lt;/p&gt;
&lt;p&gt;Could you share the project that creates this issue ? If you don&amp;#39;t want to share the project publicly, then we could convert this case into a private one, or you could create a new private question where you upload the code/project, and refers to this thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155262?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 07:42:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d078da37-2271-4cf1-8145-626855062476</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;&lt;span&gt;I was running tests for last hour on 4 different bords and it did not fail. I will give feedback after night. If it really helps probably should it be mentioned to not use clock_drv with sd.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;EDIT:&amp;nbsp;Hello. I was running tests on 4 boards overnight but they also did fail after 10, 30, 120 and 130 minutes.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155139?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 13:25:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94da8779-d674-4701-8c39-60bf2d99679a</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;I will comment it out and run tests over night to see if it helped.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155136?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 13:19:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:960e180c-fcef-4972-afeb-78ba1af256aa</guid><dc:creator>Sigurd</dc:creator><description>[quote userid="14528" url="~/f/nordic-q-a/39941/softdevice-fault/155091"]4) I only call nrf_drv_clock_init at the beginning[/quote]
&lt;p&gt;We generally don&amp;#39;t use that&amp;nbsp;driver together with the SoftDevice, since the SoftDevice controls the NRF_CLOCK when the SoftDeivce is enabled.&lt;/p&gt;
&lt;p&gt;Could you try to comment that function out, and see if the assert disappears?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155091?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 12:02:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31c4d20b-9987-4180-a94a-fc3fae0d15f5</guid><dc:creator>Michal</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;1) 2) I have long term tests that are writing data and after some period of time (different values 0-500ms) execute power off on the device. This is rather short test and I was executing it in parallel for 1 hour on 6 different devices. 3 did not fail and other were failing after 20, 40 and 45 minutes.&lt;/p&gt;
&lt;p&gt;3) nrf52832 development kit&lt;/p&gt;
&lt;p&gt;4) I only call nrf_drv_clock_init at the beginning&lt;br /&gt;&lt;br /&gt;EDIT: I am also considering option that I am writing flash too early - before fds return&amp;nbsp;init event. Can that be an option in this case, given SD fault address ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice fault</title><link>https://devzone.nordicsemi.com/thread/155057?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 10:08:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4edeac3-45cd-4e9d-b9a1-e9efbdd7faf8</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1) How often does this happen?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2) Are you able to reliably reproduce this?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3) What hardware are you running on? nRF52832 or nRF52810? custom board or development kit?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4) Are you accessing the NRF_CLOCK peripheral in your application?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>