<?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>Hardfault handler error ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82529/hardfault-handler-error</link><description>Dear Members, 
 I followed the step on : 
 https://devzone.nordicsemi.com/f/nordic-q-a/71299/getting-hardfault-error-when-using-ble-lesc-pairing/292979#292979 
 and I got this error : 
 ..\..\..\..\..\..\components\libraries\hardfault\nrf52\handler\hardfault_handler_gcc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Dec 2021 10:01:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82529/hardfault-handler-error" /><item><title>RE: Hardfault handler error ?</title><link>https://devzone.nordicsemi.com/thread/342502?ContentTypeID=1</link><pubDate>Wed, 08 Dec 2021 10:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d461374-676b-42e5-a191-f307fc4fa7ae</guid><dc:creator>RixtronixLAB</dc:creator><description>&lt;p&gt;I got the answer&lt;/p&gt;
&lt;p&gt;====&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For instance, if you use Keil you should only include&amp;nbsp;app_error_handler_keil.c. Inline assembly is handled differently in each compiler, which is why different files/code includes are required.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you try to include all these files in one project, it will fail on the two files that are not supported by your compiler.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;====&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/52772/app_error_handler_gcc-c-app_error_handler_iar-c-asm-expected-a-error"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/52772/app_error_handler_gcc-c-app_error_handler_iar-c-asm-expected-a-error&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault handler error ?</title><link>https://devzone.nordicsemi.com/thread/342498?ContentTypeID=1</link><pubDate>Wed, 08 Dec 2021 09:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d574e4a9-d090-4a2f-8255-f4cfe33d589b</guid><dc:creator>RixtronixLAB</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void HardFault_Handler(void)
{
    __ASM volatile(
    &amp;quot;   tst lr, #4                              \n&amp;quot;

    /* PSP is quite simple and does not require additional handler */
    &amp;quot;   itt ne                                  \n&amp;quot;
    &amp;quot;   mrsne r0, psp                           \n&amp;quot;
    /* Jump to the handler, do not store LR - returning from handler just exits exception */
    &amp;quot;   bne  HardFault_Handler_Continue         \n&amp;quot;

    /* Processing MSP requires stack checking */
    &amp;quot;   mrs r0, msp                             \n&amp;quot;

    &amp;quot;   ldr   r1, =__StackTop                   \n&amp;quot;
    &amp;quot;   ldr   r2, =__StackLimit                 \n&amp;quot;

    /* MSP is in the range of the stack area */
    &amp;quot;   cmp   r0, r1                            \n&amp;quot;
    &amp;quot;   bhi   HardFault_MoveSP                  \n&amp;quot;
    &amp;quot;   cmp   r0, r2                            \n&amp;quot;
    &amp;quot;   bhi   HardFault_Handler_Continue        \n&amp;quot;

    &amp;quot;HardFault_MoveSP:                          \n&amp;quot;
    &amp;quot;   mov   sp, r1                            \n&amp;quot;
    &amp;quot;   mov   r0, #0                            \n&amp;quot;

    &amp;quot;HardFault_Handler_Continue:                \n&amp;quot;
    &amp;quot;   ldr r3, =%0                             \n&amp;quot;
    &amp;quot;   bx r3                                   \n&amp;quot;
    &amp;quot;   .ltorg                                  \n&amp;quot;
    : : &amp;quot;X&amp;quot;(HardFault_c_handler)
    );
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>