<?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>app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57402/app_error_fault_handler-missing-p_file_name-and-line_num</link><description>I am trying to debug an app error in my code. I have an app_error_fault_handler that starts like this: 
 
 
 
 But, the &amp;quot;Fatal Error in file...&amp;quot; line doesn&amp;#39;t show the file name and line number. I use this fault handler on other systems, and I&amp;#39;ve seen</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 12 Apr 2020 03:33:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57402/app_error_fault_handler-missing-p_file_name-and-line_num" /><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/244251?ContentTypeID=1</link><pubDate>Sun, 12 Apr 2020 03:33:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ed8f016-f951-4954-a381-603d2c56d76e</guid><dc:creator>michaelhobo</dc:creator><description>&lt;p&gt;Adding -DDEBUG solved it for me! Sorry for the late reply, I was focused on something else.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/233649?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2020 08:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5c69971-a5fd-4d69-a68a-5914ad2c3b70</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Try adding&amp;nbsp;&lt;span&gt;DEBUG in your preprocessor defines, both as C flag and assembler flag.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CFLAGS&lt;/span&gt;&lt;span&gt;&amp;nbsp;+=&amp;nbsp;-DDEBUG&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;ASMFLAGS&lt;/span&gt;&lt;span&gt;&amp;nbsp;+=&amp;nbsp;-DDEBUG&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;If that does not help, try looking at the call stack with&amp;nbsp;&lt;a href="https://www.segger.com/products/development-tools/ozone-j-link-debugger/"&gt;Ozone&lt;/a&gt;&amp;nbsp;(use the generated .elf file with Ozone) to see where the error&amp;nbsp;originated from.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/233387?ContentTypeID=1</link><pubDate>Sat, 08 Feb 2020 02:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0437440-01f3-425a-b7f4-6a50baf38ebd</guid><dc:creator>michaelhobo</dc:creator><description>&lt;p&gt;I put an APP_ERROR_CHECK(NRF_ERROR_BUSY); right after initializing logging, and same issue occurs, with NRF_ERROR_BUSY instead. So I&amp;#39;m pretty sure it&amp;#39;s some config issue (sdk_config.h? gcc flags?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/233386?ContentTypeID=1</link><pubDate>Sat, 08 Feb 2020 01:52:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f52781f3-e1e6-4bb3-90a4-eb4888a9c927</guid><dc:creator>michaelhobo</dc:creator><description>&lt;p&gt;PC is also 0.&lt;/p&gt;
&lt;p&gt;And no difference with -O0 (I was using -Os before)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/233156?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 21:49:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c62eb378-ffd4-4a87-b0f5-4b8a25f172a1</guid><dc:creator>Sigurd</dc:creator><description>[quote user="michaelhobo"]perhaps there&amp;#39;s some flag that i&amp;#39;m missing?[/quote]
&lt;p&gt;Do&amp;nbsp;you see any difference if you in the makefile change:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Optimization flags
OPT = -O3 -g3&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Optimization flags
OPT = -O0 -g3&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="michaelhobo"]the file name and line number are still empty[/quote]
&lt;p&gt;&amp;nbsp;Is the pc value also 0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/233128?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 17:08:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8c74b02-9b74-4c3c-a941-94a9779593c5</guid><dc:creator>michaelhobo</dc:creator><description>&lt;p&gt;I&amp;#39;m using GCC, perhaps there&amp;#39;s some flag that i&amp;#39;m missing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/233127?ContentTypeID=1</link><pubDate>Thu, 06 Feb 2020 17:06:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d21e7051-2383-449c-90e6-59e5ba419334</guid><dc:creator>michaelhobo</dc:creator><description>&lt;p&gt;i&amp;#39;m using a modified SDK 14.2.&amp;nbsp;My handler just hooks into my own logging libraries, and has extra waits for debugging purposes. When I replace my handler with the default one from SDK16.0 (with minor modifications), it still doesn&amp;#39;t solve my problem. I get the error:&lt;/p&gt;
&lt;p&gt;00&amp;gt; &amp;lt;error&amp;gt; app: ERROR 8 [NRF_ERROR_INVALID_STATE] at :0&lt;/p&gt;
&lt;p&gt;As you can see, the file name and line number are still empty, and I don&amp;#39;t see anything in the error handler that would help with that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_error_fault_handler missing p_file_name and line_num</title><link>https://devzone.nordicsemi.com/thread/232863?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2020 14:23:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1eba74a-f8f4-4134-8edb-396ddaa69f1a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;What SDK&amp;nbsp;version is this? Why not use the default&amp;nbsp;app_error_fault_handler() ?&lt;/p&gt;
&lt;p&gt;from SDK 16.0:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;__WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
{
    __disable_irq();
    NRF_LOG_FINAL_FLUSH();

#ifndef DEBUG
    NRF_LOG_ERROR(&amp;quot;Fatal error&amp;quot;);
#else
    switch (id)
    {
#if defined(SOFTDEVICE_PRESENT) &amp;amp;&amp;amp; SOFTDEVICE_PRESENT
        case NRF_FAULT_ID_SD_ASSERT:
            NRF_LOG_ERROR(&amp;quot;SOFTDEVICE: ASSERTION FAILED&amp;quot;);
            break;
        case NRF_FAULT_ID_APP_MEMACC:
            NRF_LOG_ERROR(&amp;quot;SOFTDEVICE: INVALID MEMORY ACCESS&amp;quot;);
            break;
#endif
        case NRF_FAULT_ID_SDK_ASSERT:
        {
            assert_info_t * p_info = (assert_info_t *)info;
            NRF_LOG_ERROR(&amp;quot;ASSERTION FAILED at %s:%u&amp;quot;,
                          p_info-&amp;gt;p_file_name,
                          p_info-&amp;gt;line_num);
            break;
        }
        case NRF_FAULT_ID_SDK_ERROR:
        {
            error_info_t * p_info = (error_info_t *)info;
            NRF_LOG_ERROR(&amp;quot;ERROR %u [%s] at %s:%u\r\nPC at: 0x%08x&amp;quot;,
                          p_info-&amp;gt;err_code,
                          nrf_strerror_get(p_info-&amp;gt;err_code),
                          p_info-&amp;gt;p_file_name,
                          p_info-&amp;gt;line_num,
                          pc);
             NRF_LOG_ERROR(&amp;quot;End of error report&amp;quot;);
            break;
        }
        default:
            NRF_LOG_ERROR(&amp;quot;UNKNOWN FAULT at 0x%08X&amp;quot;, pc);
            break;
    }
#endif

    NRF_BREAKPOINT_COND;
    // On assert, the system can only recover with a reset.

#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>