<?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>No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33715/no-stack-trace-in-app_error_fault_handler</link><description>Can anyone tell all the potential reasons for stack corruption? I&amp;#39;m debuging a problem where sometimes there is no stack trace when putting a breakpoint on the first line of the app_error_fault_handler. I&amp;#39;m causing a deliberate crash by putting an APP_ERROR_HANDLER</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Jun 2019 21:19:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33715/no-stack-trace-in-app_error_fault_handler" /><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/191719?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2019 21:19:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:377b444e-3292-43d0-9215-35b55d49846a</guid><dc:creator>fkoran</dc:creator><description>&lt;p&gt;I have the same issue. Segger 4.16, the DEBUG flag is set. Optimization level is set to &amp;#39;debug&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/189121?ContentTypeID=1</link><pubDate>Sat, 25 May 2019 02:43:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23f7764d-ca70-4758-b930-fa0ea169ea77</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;That assembly doesn&amp;#39;t push the frame pointer (r11) and then set it to point to the new stack location. That probably breaks the stack trace.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/189054?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 12:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfa49a17-f23f-437d-a0ca-093d1ba8a5e9</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;I&amp;#39;m also seeing this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/156931?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 14:56:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:664e494c-625d-481b-84f4-0b76ebcfb80c</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What IDE are you using? Have you set the DEBUG flag?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/156388?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 21:55:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1e34c49-caaf-497b-9f9a-609a290c58ee</guid><dc:creator>abhipray</dc:creator><description>&lt;p&gt;I am seeing the same issue using SDK 15.2. When APP_ERROR_CHECK triggers a call to app_error_handler(), the call stack is retained. Once it finishes executing the assembly inside app_error_handler() and enters app_error_fault_handler(), it loses the call stack. I have tested to see if it was a problem with app_error_fault_handler() by using the WEAK implementation and also by calling it directly in place of APP_ERROR_CHECK, and it doesn&amp;#39;t appear to be the problem. It looks like the corruption is happening in the app_error_handler() assembly.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/137618?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 08:44:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baa096ea-a22d-47fc-b0d5-61c8d2521de9</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I&amp;#39;m guessing the compiler optimizes the loop as it knows the while(true) check will always pass. When you introduce a volatile variable you tell the compiler not to optimize this piece of code as you expect the variable to change during runtime. The optimization yields code that&amp;nbsp;is not debug friendly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/135400?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 15:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fec6a952-5222-4262-8883-20394def691f</guid><dc:creator>A Knecht</dc:creator><description>&lt;p&gt;I just found that the call stack doesn&amp;#39;t disappear when I replace while(true) with volatile bool loop = true; while(loop)&lt;/p&gt;
&lt;p&gt;This is analogous to line 111 in app_error.c (SDK 14.0.0).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The following variable helps Keil keep the call stack visible, ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volatile bool loop = true;&lt;/p&gt;
&lt;p&gt;Can any Nordic employee share some insights as to why this is required and how it works?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/130952?ContentTypeID=1</link><pubDate>Fri, 04 May 2018 08:24:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02cfa40c-4cd3-4b29-9ce7-10a6decdda0f</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What happens if you copy the weak implementation into your main.c (overrides from main context) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/130738?ContentTypeID=1</link><pubDate>Thu, 03 May 2018 07:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b7ceada-5e1e-4a3b-9c35-298364a1a3ae</guid><dc:creator>A Knecht</dc:creator><description>&lt;p&gt;No, interestingly not. It&amp;#39;s only when I use my implementation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/130640?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 15:07:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44554735-57b3-46f7-9764-680558d467d8</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Do you see the same issue if you use the weak implementation of&amp;nbsp;app_error_fault_handler() in app_error_weak.c?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/130623?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 14:24:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:800d6c3f-3ae9-40db-9236-079674654239</guid><dc:creator>A Knecht</dc:creator><description>&lt;p&gt;APP_ERROR_FAULT_HANDLER(0)&lt;/p&gt;
&lt;p&gt;(I&amp;#39;m causing a deliberate crash by putting this statement in the first line of the main function.) What&amp;#39;s unexpected is that there is no stack trace.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/130604?ContentTypeID=1</link><pubDate>Wed, 02 May 2018 13:47:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57c30e11-b1c8-4e2a-860e-19107a28df40</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What&amp;#39;s on line 0x81 of main.c?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/130227?ContentTypeID=1</link><pubDate>Mon, 30 Apr 2018 07:39:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e556e97-7ec9-4e2b-93fa-85d0377e2ede</guid><dc:creator>A Knecht</dc:creator><description>&lt;p&gt;id: 0x4001&lt;br /&gt;pc the one passed into the fault handler: 0x0&lt;br /&gt;info: 0x2000dc00&lt;br /&gt;&amp;nbsp; the contents as expected: (0x81, &amp;#39;..\main.c&amp;#39; and 0)&lt;br /&gt;R15 (pc) is: 0x27972&lt;br /&gt;and lr: 0x279b3&lt;br /&gt;location/value of the only item on the stack trace (app_error_fault_handler) also reads 0x0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/129985?ContentTypeID=1</link><pubDate>Thu, 26 Apr 2018 13:50:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b0b3653-2824-427b-bf28-93ba72fdbd80</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What&amp;#39;s the value of id, pc, and info?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/129906?ContentTypeID=1</link><pubDate>Thu, 26 Apr 2018 09:28:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1120bf9f-acd0-4e79-b2ce-e8186d702763</guid><dc:creator>A Knecht</dc:creator><description>&lt;p&gt;Tested it, this didn&amp;#39;t change anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No stack trace in app_error_fault_handler</title><link>https://devzone.nordicsemi.com/thread/129551?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 12:01:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e3a1754-61e8-40aa-80a9-f067662ca631</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey Andreas,&lt;/p&gt;
&lt;p&gt;Try calling APP_ERROR_CHECK(arg), where arg is 1-17 dec, instead of&amp;nbsp;APP_ERROR_HANDLER(0) .&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>