<?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>System reset after Soft device assert</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66734/system-reset-after-soft-device-assert</link><description>I am using SDK 17 currently and nrf52840. I have read through the Q&amp;amp;As in the Dev zone and have not found the exact answer. So it might be a good idea to ask here 
 I understand that in rare cases when the soft device asserts, one should call system reset</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Oct 2020 14:32:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66734/system-reset-after-soft-device-assert" /><item><title>RE: System reset after Soft device assert</title><link>https://devzone.nordicsemi.com/thread/273539?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 14:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3abb9a25-f58d-40be-9b16-a4b96982e67b</guid><dc:creator>davidz</dc:creator><description>&lt;p&gt;Thank you very much. It is clear now :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System reset after Soft device assert</title><link>https://devzone.nordicsemi.com/thread/273461?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 11:12:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de8de408-16bd-4199-954a-79440c2a5726</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;This function will prepare the error messages and Branch to the function app_error_fault_handler (The bl instruction at line 19)&lt;/p&gt;
&lt;p&gt;Error handler documentation for reference: &lt;span&gt;&lt;a title="Error module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_error.html?cp=7_1_3_13"&gt;Error module&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System reset after Soft device assert</title><link>https://devzone.nordicsemi.com/thread/273304?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 16:13:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05906107-c410-430c-b45a-f7e4f79c9391</guid><dc:creator>davidz</dc:creator><description>&lt;p&gt;Thank you very much. I am using nrf52840 dk and project in release mode. I would like to double-confirm this, since I found that the code that forward the error to app_error_fault_handler is greyed out in app_error_handler_gcc.c. Instead, the following assembly code is used:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void app_error_handler(ret_code_t error_code, uint32_t line_num, const uint8_t * p_file_name)
{
    __ASM volatile(

    &amp;quot;push {lr}                      \n&amp;quot;

    /* reserve space on stack for error_info_t struct - preserve 8byte stack aligment */
    &amp;quot;sub sp, sp, %0                 \n&amp;quot;

    /* prepare error_info_t struct */
    &amp;quot;str r0, [sp, %1]               \n&amp;quot;
    &amp;quot;str r1, [sp, %3]               \n&amp;quot;
    &amp;quot;str r2, [sp, %2]               \n&amp;quot;

    /* prepare arguments and call function: app_error_fault_handler */
    &amp;quot;ldr r0, =%4                    \n&amp;quot;
    &amp;quot;mov r1, lr                     \n&amp;quot;
    &amp;quot;mov r2, sp                     \n&amp;quot;
    &amp;quot;bl  %5                         \n&amp;quot;

    /* release stack */
    &amp;quot;add sp, sp, %0                 \n&amp;quot;

    &amp;quot;pop {pc}                       \n&amp;quot;
    &amp;quot;.ltorg                         \n&amp;quot;

    : /* Outputs */
    : /* Inputs */
    &amp;quot;I&amp;quot; (APP_ERROR_ERROR_INFO_SIZE_ALIGNED_8BYTE),
    &amp;quot;I&amp;quot; (APP_ERROR_ERROR_INFO_OFFSET_ERR_CODE),
    &amp;quot;I&amp;quot; (APP_ERROR_ERROR_INFO_OFFSET_P_FILE_NAME),
    &amp;quot;I&amp;quot; (APP_ERROR_ERROR_INFO_OFFSET_LINE_NUM),
    &amp;quot;X&amp;quot; (NRF_FAULT_ID_SDK_ERROR),
    &amp;quot;X&amp;quot; (app_error_fault_handler)
    : /* Clobbers */
    &amp;quot;r0&amp;quot;, &amp;quot;r1&amp;quot;, &amp;quot;r2&amp;quot;
    );
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System reset after Soft device assert</title><link>https://devzone.nordicsemi.com/thread/273112?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 08:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc82eac2-c177-4ac1-ac7a-af383d512140</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;app_error_handler will forward the error to app_error_fault_handler, unless the app_error_fault_handler is redefined. Depending on the preprocessor flags this will either halt (in debug mode) or reset:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifndef DEBUG
    NRF_LOG_WARNING(&amp;quot;System reset&amp;quot;);
    NVIC_SystemReset();
#else
    app_error_save_and_stop(id, pc, info);
#endif // DEBUG&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>