<?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 for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20635/hardfault-for-simple-freertos-application</link><description>Following is a simple application that I have created. It has no softdevice and the configuration is very similar to blinky freeRTOS example. 
 Source code: 
 main.c 
 All tasks are activated once but then I get a hardfault and it is rather tedious</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Mar 2017 10:11:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20635/hardfault-for-simple-freertos-application" /><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80440?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2017 10:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf56e4d4-8486-4c54-b427-87b16a3ed17b</guid><dc:creator>himanshu pande</dc:creator><description>&lt;p&gt;Hi Aryan, I did lot of mix and match with all the above options and its CFLAGS += -DSOFTDEVICE_PRESENT option that causes the trap. Rest all options don&amp;#39;t affect the system at all. Is this a bug or is this normal behavior? i.e. dont enable softdevice when we don&amp;#39;t use it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80438?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2017 09:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:437d0eb4-4724-4079-9228-46ae5c57d9a5</guid><dc:creator>himanshu pande</dc:creator><description>&lt;p&gt;How is the option -D__STACK_SIZE related to configTOTAL_HEAP_SIZE parameter in FreeRTOS?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80439?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 21:14:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ceefe653-82a5-4450-b942-2f4304f65934</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;seems like you are getting memory corruption in the stack. Set the heap size to 0 and increase the stack by 1KB and enable back these options to see what happens.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80437?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 08:50:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a777239-aa2f-4f86-b061-91872e41441c</guid><dc:creator>himanshu pande</dc:creator><description>&lt;p&gt;I have got the software working. It was with the compiler options.&lt;/p&gt;
&lt;p&gt;I had following compiler option other than blinky freeRTOS project:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;CFLAGS += -DSOFTDEVICE_PRESENT&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I removed this option and the tasks arrive without glitches.&lt;/p&gt;
&lt;p&gt;(Similarly for ASMFLAGS)&lt;/p&gt;
&lt;p&gt;So, in conclusion, do not enable softdevice if your project doesn&amp;#39;t use it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80434?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 08:46:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a613ea0c-fb62-4dd7-b2d0-ed60db4cb6d8</guid><dc:creator>himanshu pande</dc:creator><description>&lt;p&gt;I have already added that code to hard fault handler which generated additional log like stacked registers and trap related registers in cortex m4.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80435?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 15:58:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a0020cd-1109-4c5f-a043-7c680eaa8ecf</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;I think there is code on the web for a hard fault handler that gives more information about the fault by putting the PC and other info (even a full stack trace?) in memory where you can examine it from the debugger.  Does the hard fault handler  from Nordic (in their /library directory of the SDK?) give more information than the default hard fault handler?  Its not simple and it is tedious, but it is possible to examine the stack from the debugger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80433?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 14:55:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:755bde7f-6f8e-4a70-b308-ab2ead6ddc2f</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What chipset and SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault for simple freeRTOS application</title><link>https://devzone.nordicsemi.com/thread/80436?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 10:42:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7716ca1f-fa0c-4a90-bed3-6cfc3722cc34</guid><dc:creator>himanshu pande</dc:creator><description>&lt;p&gt;Here is some further insight into the issue as I refer this &lt;a href="http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html"&gt;FreeRTOS_Debug&lt;/a&gt; link.&lt;/p&gt;
&lt;p&gt;HARDFAULT:ERROR:START OF FULL LOG&lt;/p&gt;
&lt;p&gt;HARDFAULT:ERROR:R0 R1 R2 R3 R12 : 0x0 0x20001950 0x10000 0x200020c8 0xa5a5a5a5
HARDFAULT:ERROR:LR PC PSR BFSR : 0x8 0x8 0x6000000b 0x200
HARDFAULT:ERROR:CFSR HFSR DFSR AFSR MMAR BFAR  : 0x20000 0x40000000 0x0 0x0 0xe000ed34 0xe000ed38&lt;/p&gt;
&lt;p&gt;HARDFAULT:ERROR:END OF FULL LOG&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>