<?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>How to decode info in app_error_save_and_stop</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32387/how-to-decode-info-in-app_error_save_and_stop</link><description>When I trap an error in app_error.c in app_error_save_and_stop, 
 
 I mostly get a filename, line number, and an error code that I can understand. 
 
 However, sometimes I don’t get a filename, but instead get some octets: 
 Name : m_error_data.p_error_info</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Jun 2020 06:36:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32387/how-to-decode-info-in-app_error_save_and_stop" /><item><title>RE: How to decode info in app_error_save_and_stop</title><link>https://devzone.nordicsemi.com/thread/252617?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 06:36:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77b1c0e7-8438-44ab-b2fe-08c564261c4b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I can tell from the values that you are reading from the vector table at address 0. In other words, you don&amp;#39;t have a valid info pointer. I suggest you create a new ticket with more details about the problem. And remember to mention what SDK and SD version you use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to decode info in app_error_save_and_stop</title><link>https://devzone.nordicsemi.com/thread/252470?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 15:50:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57c8b094-3a9b-4456-9ee1-adfe3b60dca3</guid><dc:creator>Somesh Burkule</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have debugged my code and getting&amp;nbsp;NRF_FAULT_ID_SDK_ERROR with following info:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; err_code: 0x0000057D&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;line_num: 0x20000400&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;p_file_name: 0x000008E9&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to decode this?&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to decode info in app_error_save_and_stop</title><link>https://devzone.nordicsemi.com/thread/124927?ContentTypeID=1</link><pubDate>Mon, 19 Mar 2018 09:11:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62290fd0-74cc-4ff1-a5b7-b521e061761b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;m_error_data.fault_id corresponds to the id parameter passed to app_error_save_and_stop(uint32_t id, uint32_t pc, uint32_t info), and is used to determine the error source - i.e., if it is a SDK or Softdevice error.&lt;/p&gt;
&lt;p&gt;Only SDK errors include&amp;nbsp;pointers to&amp;nbsp;assert_info_t and&amp;nbsp;error_info_t. For softdevice asserts , the info pointer will in most case be zero:&amp;nbsp;&lt;/p&gt;
&lt;div class="memitem"&gt;
&lt;div class="memproto"&gt;
&lt;table class="memname"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="memname" colspan="1" rowspan="1"&gt;#define NRF_FAULT_ID_APP_MEMACC&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;a class="el" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v5.0.0/group___n_r_f___f_a_u_l_t___i_d___r_a_n_g_e_s.html#ga06641290a0e19c42546212874739c38d"&gt;NRF_FAULT_ID_APP_RANGE_START&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;+ 1)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="memdoc"&gt;
&lt;p&gt;Application invalid memory access (nRF52 only).&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;The info parameter will contain 0x00000000, in case of SoftDevice RAM access violation&lt;/strong&gt;. In case of SoftDevice peripheral register violation the info parameter will contain the sub-region number of PREGION[0], on whose address range the disallowed write access caused the memory access fault.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="memitem"&gt;
&lt;div class="memproto"&gt;
&lt;table class="memname"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="memname" colspan="1" rowspan="1"&gt;#define NRF_FAULT_ID_SD_ASSERT&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;a class="el" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v5.0.0/group___n_r_f___f_a_u_l_t___i_d___r_a_n_g_e_s.html#gac8d2afc952ef4acf65779e5724af7c0c"&gt;NRF_FAULT_ID_SD_RANGE_START&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;+ 1)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="memdoc"&gt;
&lt;p&gt;SoftDevice assertion.&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;The info parameter is reserved for future used&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;This means that if you use the info pointer, and there was a softdevice assert, you are most likely going to be reading out the vector table at address 0x0 in flash.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;MBR vector table from s132 v3.0.0 which corresponds with the error information you got:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1521450139978v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note: I used the&amp;nbsp;default app_error_save_and_stop() implementation&amp;nbsp; from SDK 12.3.0 as reference:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void app_error_save_and_stop(uint32_t id, uint32_t pc, uint32_t info)
{
    /* static error variables - in order to prevent removal by optimizers */
    static volatile struct
    {
        uint32_t        fault_id;
        uint32_t        pc;
        uint32_t        error_info;
        assert_info_t * p_assert_info;
        error_info_t  * p_error_info;
        ret_code_t      err_code;
        uint32_t        line_num;
        const uint8_t * p_file_name;
    } m_error_data = {0};

    // The following variable helps Keil keep the call stack visible, in addition, it can be set to
    // 0 in the debugger to continue executing code after the error check.
    volatile bool loop = true;
    UNUSED_VARIABLE(loop);

    m_error_data.fault_id   = id;
    m_error_data.pc         = pc;
    m_error_data.error_info = info;

    switch (id)
    {
        case NRF_FAULT_ID_SDK_ASSERT:
            m_error_data.p_assert_info = (assert_info_t *)info;
            m_error_data.line_num      = m_error_data.p_assert_info-&amp;gt;line_num;
            m_error_data.p_file_name   = m_error_data.p_assert_info-&amp;gt;p_file_name;
            break;

        case NRF_FAULT_ID_SDK_ERROR:
            m_error_data.p_error_info = (error_info_t *)info;
            m_error_data.err_code     = m_error_data.p_error_info-&amp;gt;err_code;
            m_error_data.line_num     = m_error_data.p_error_info-&amp;gt;line_num;
            m_error_data.p_file_name  = m_error_data.p_error_info-&amp;gt;p_file_name;
            break;
    }

    UNUSED_VARIABLE(m_error_data);

    // If printing is disrupted, remove the irq calls, or set the loop variable to 0 in the debugger.
    __disable_irq();
    while (loop);

    __enable_irq();
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to decode info in app_error_save_and_stop</title><link>https://devzone.nordicsemi.com/thread/124820?ContentTypeID=1</link><pubDate>Fri, 16 Mar 2018 18:00:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ff9ab5c-7a0a-4693-b8e5-5fde2624cbd4</guid><dc:creator>dcollier8</dc:creator><description>&lt;p&gt;Error code was 1401 (0x579), sorry I left that out. None of the links in your reply match these codes. Is there any way to decode them or look them up ? Line number = 0x400, filename= 0x8e5&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to decode info in app_error_save_and_stop</title><link>https://devzone.nordicsemi.com/thread/124819?ContentTypeID=1</link><pubDate>Fri, 16 Mar 2018 17:52:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef13e0a1-01e0-47f9-bfb9-f422797ab50c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The info pointer will typically be set to &amp;#39;NULL&amp;#39; in case of a softdevice assert, and only include fault id and a pc value (PC shows where the assert occurred internally in the softdevice). You can determine if it was a softdevice assert by checking the .fault_id against the fault id types &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group___a_p_p___e_r_r_o_r___f_a_u_l_t___i_d_s.html"&gt;here &lt;/a&gt;and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v5.0.0/group___n_r_f___f_a_u_l_t___i_d_s.html"&gt;here&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>