# Sporadic hard faults, how to find reason

**URL:** <https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026>\
**Category:** Kernel\
**Created:** [January 30, 2016, 12:21am UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026 "2016-01-30T00:21:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 30, 2016, 12:21am UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/1 "2016-01-30T00:21:54Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Saturday, January 30, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#8233):

Hi,  
my system has sporadic hard faults, this means, working over night, or crashes within minutes and all between.  
I use the suggested code:

void prvGetRegistersFromStack( uint32\_t _pulFaultStackAddress )  
{  
/_ These are volatile to try and prevent the compiler/linker optimising them  
away as the variables never actually get used. If the debugger won’t show the  
values of the variables, make them global my moving their declaration outside  
of this function. _/  
volatile uint32\_t r0;  
volatile uint32\_t r1;  
volatile uint32\_t r2;  
volatile uint32\_t r3;  
volatile uint32\_t r12;  
volatile uint32\_t lr; /_ Link register. _/  
volatile uint32\_t pc; /_ Program counter. _/  
volatile uint32\_t psr;/_ Program status register. \*/

```
r0 = pulFaultStackAddress[0];
r1 = pulFaultStackAddress[1];
r2 = pulFaultStackAddress[2];
r3 = pulFaultStackAddress[3];

r12 = pulFaultStackAddress[4];
lr = pulFaultStackAddress[5];
pc = pulFaultStackAddress[6];
psr = pulFaultStackAddress[7];

/* When the following line is hit, the variables contain the register values. */
for( ;; );

```

}

Now I need some help to analyse the reason for the crash. All registers except psr were 0. Even pc is 0.  
Any idea how to get closer to the problem?

Thanks again for helping.

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 30, 2016, 11:21am UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/2 "2016-01-30T11:21:02Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Saturday, January 30, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#2be5):

Doesnt sound right. Can you show the code that calls prvGetRegistersFromStack() too. You might need to dig deeper into the Cortex system registers to see what caused the hard fault (memory access, what ever). You could also use the trace tool with a circular trace buffer that is stopped in the fault handler.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 30, 2016, 1:42pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/3 "2016-01-30T13:42:20Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Saturday, January 30, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#2be5/928d):

Thanks, any documents around to set up the trace tool with such a buffer configuration ?

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 30, 2016, 9:42pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/4 "2016-01-30T21:42:21Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Saturday, January 30, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#3c31):

Hi,  
ok, tried to follow the instructions in this document, but it ends up getting 93 errors …  
[http://www.atmel.com/images/atmel-42382-getting-started-with-freertos-on-atmel-sam-flash-mcus\_applicationnote\_at04056.pdf](http://www.atmel.com/images/atmel-42382-getting-started-with-freertos-on-atmel-sam-flash-mcus_applicationnote_at04056.pdf)

Maybe there is a version conflict, as the files having different names. In my source of the trace recorder I dont have a file called trcHooks.h, but I have trcKernelHooks.h.

I cut it out now, so my project compiles again,

Any suggestion how to get it running. Which port should I use for a sam4N, I choose ARM Cortex-M, maybe thats the mistake?

Thanks for helping

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 31, 2016, 8:46am UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/5 "2016-01-31T08:46:14Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#3c31/7a61):

> Any suggestion how to get it running.

If you are using Atmel Studio, then you may find the ASF already has a  
simple FreeRTOS project for that part. Try using the ASF wizard, select  
your part, and then see which projects are provided for that part (there  
is likely to be a lot, a couple of which are likely to be FreeRTOS  
projects).

Otherwise the following links might be helpful:

> **[Creating a new RTOS project](https://www.freertos.org/Creating-a-new-FreeRTOS-project.html)**
>
> Create and use an RTOS project

> **[FreeRTOS - Porting a FreeRTOS demo to a different hardware platform](https://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html)**
>
> FreeRTOS is a portable, open source, mini Real Time kernel. A free RTOS for small embedded systems

> Wich port should I use for a  
> sam4N, I choose ARM Curtex-M, maybe thats the mistake?

With any Cortex-M4 microcontroller, if the microcontroller has a  
floating point unit (FPU) then use the code from  
FreeRTOS/Source/portable/[compiler]/ARM\_CM4F, otherwise use the code  
from FreeRTOS/Source/portable/[compiler]/ARM\_CM3.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 11:22am UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/6 "2016-01-31T11:22:56Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#7d5b):

Hi,  
thanks.  
But, I have a running application for my SAM4N and I use Atmel Studio V6.2. Now I want to add the trace recorder, but this wouldn’t work out …  
In the file trcConfig.h I am ordered to enter a port option, here I choose Cortex-M, hoping this is the correct port (of the trace recorder) for my SAM4N.  
The port of the FreeRTOS 7.3.0 I still use works correct for my app, nothing to change for now.

Its only about adding the trace recoder to an exixting application.

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 2:17pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/7 "2016-01-31T14:17:10Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#aa19):

Hi,  
to be more precise:

First problem appear in trcHardwarePort.c. In the function prvTraceInitCortexM, near the end the statements:

if (RecorderDataPtr-\>frequency == 0)  
{  
RecorderDataPtr-\>frequency = TRACE\_CPU\_CLOCK\_HZ / HWTC\_DIVISOR;  
}

fail, cause the macros used here lastly end up calling ‘sysclk\_get\_cpu\_hz’

Problem is now, which file where to include to solve this and not produce lots of duplicate definitions elswhere …

It sounds like a basic issue, maybe the document describing the integration of the trace recorder lib should be updated to reflect the needs of the current version.

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 31, 2016, 2:50pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/8 "2016-01-31T14:50:43Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#aa19/b383):

This looks Atmel specific. I’m guessing TRACE\_CPU\_CLOCK\_HZ is somewhere  
referencing configCPU\_CLOCK\_HZ (which is in FreeRTOSConfig.h), and  
configCPU\_CLOCK\_HZ is calling sysclk\_get\_cpu\_hz (which I think is an  
Atmel library function) rather than just hard coding the clock speed.

If you right click on TRACE\_CPU\_CLOCK\_HZ you should find its definition,  
and follow it back to the base definition. I’m guessing replacing  
sysclk\_get\_cpu\_hz() with the actual clock speed as a hard coded value  
will fix the issue.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 3:13pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/9 "2016-01-31T15:13:39Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#f0cb):

… I actually trace this back as you suggested:  
trcHardwarePort.c references trcKernelPort.h:

```auto
#if (USE_TRACEALYZER_RECORDER == 1)

/* Defines that must be set for the recorder to work properly */
#define TRACE_KERNEL_VERSION 0x1AA1
#define TRACE_TICK_RATE_HZ configTICK_RATE_HZ /* Defined in "FreeRTOS.h" */
#define TRACE_CPU_CLOCK_HZ configCPU_CLOCK_HZ /* Defined in "FreeRTOSConfig.h" */

#if (SELECTED_PORT == PORT_ARM_CortexM)

```

And in FreeRTOS.h I have the definitions as normal. Doesn’t changed anything here. Without trace recorder, my FreeRTOS based application works fine.

Here the macros:

```auto
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( sysclk_get_cpu_hz() )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 150 )

```

If in FreeRTOS.h there were a mistake, my app would not compile, is this correct?

Ok, maybe keying in the CPU frequency for TRACE\_CPU\_CLK\_HZ would help, the … DIVISOR also use this macro …

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 31, 2016, 3:18pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/10 "2016-01-31T15:18:28Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#f0cb/2f85):

This is what I suspected:

#define configCPU\_CLOCK\_HZ ( sysclk\_get\_cpu\_hz() )

Did you try replacing the call to sysclk\_get\_cpu\_hz() with the hard  
coded clock frequency, as just suggested?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 3:41pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/11 "2016-01-31T15:41:45Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#a4dd):

Yes, but now other issues popping up … endless strory  
Has anybody tried it before, look and feel is, that this hasn’t worked out before …

Now the statement ‘’ include “trcKernelHooks.h” informed me, that this file isn’t available ??? I still can see the file. And with right click and ‘Go to implementation’ I get exactly there.

When I use an absolute path, the error is gone and I get 97 errors telling me about lots of duplicated definitions. So, better to exclude this file? But not included gives also an error. Really great stuff.

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 3:50pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/12 "2016-01-31T15:50:02Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#3d85):

I add a shot. I exactly tried as in this document is suggested:  
[http://www.atmel.com/images/atmel-42382-getting-started-with-freertos-on-atmel-sam-flash-mcus\_applicationnote\_at04056.pdf](http://www.atmel.com/images/atmel-42382-getting-started-with-freertos-on-atmel-sam-flash-mcus_applicationnote_at04056.pdf)

Doing both, adding a folder as you see in the attachment and adding a search path solves some how the duplicate definitions, but not every time. Depends which of the statements fail and which not.

It is a lottery …

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 31, 2016, 3:51pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/13 "2016-01-31T15:51:06Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#6592):

> Has anybody tried it before, look and feel is, that this hasn’t worked out before

Um, “yes”, a few hundred if not thousands of people, me included.

Attached you will find what I am using on an EFM32 - which is also a Cortex-M, so should be the same. The zip file has the files and path I have in the project, and the header file is the config file. These are from a training I did before Christmas, so might not be the latest version.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 4:21pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/14 "2016-01-31T16:21:18Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#f912):

Thanks, will see where is the difference. I have to use FreeRTOS 7.3.0, so far from the latest version, cause Atmel didn’t support an other version on SAM4N MCU.

Hope there is a way to have a ‘TRACE’ version and a DEBUG version of my project, have to work on the app not playing around with trace integration. Uptil now I didn’t need a trace, but once a day it would be helpful. Especially as I want to find the sopradic crashes, see start of this discussion. But if integration is that hard …

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 4:28pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/15 "2016-01-31T16:28:26Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#2561):

… where should I place the trcConfig.h file. I have a Config folder where the FreeRTOSConfig.h resides and some more, is this the exact place for it ? (I guess … but …)

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 4:48pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/16 "2016-01-31T16:48:45Z")

</div>

**[alainm3](https://sourceforge.net/u/alainm3/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#6592/f12b):

I am following this and I have a different experience !!!

Up to now, _ **ALL** _ my sporadic hardfaults happend because of stack  
overflow (CM3 and yes, I have been lucky…).  
I included in the system a stack report function, almost exactly as  
exists in the Examples sections and now I can diagnose that in seconds.

I tested the stack detection feature that exists in FreeRTOS specific  
tests and I discovered that it failed to avoid the hard fault in most  
tested situations…

Alain

On 31-01-2016 13:51, Real Time Engineers ltd. wrote:

> ```
> Has anybody tried it before, look and feel is, that this hasn't
> worked out before
> 
> ```
> 
> Um, “yes”, a few hundred if not thousands of people, me included.
> 
> Attached you will find what I am using on an EFM32 - which is also a  
> Cortex-M, so should be the same. The zip file has the files and path I  
> have in the project, and the header file is the config file. These are  
> from a training I did before Christmas, so might not be the latest  
> version.
> 
> Attachments:
> 
> - FreeRTOS+Trace.7z  
> [https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/6592/attachment/FreeRTOS%2BTrace.7z](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/6592/attachment/FreeRTOS%2BTrace.7z)  
> (43.5 kB; application/octet-stream)
> - trcConfig.h  
> [https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/6592/attachment/trcConfig.h](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/6592/attachment/trcConfig.h)  
> (22.7 kB; text/plain)
> 
> * * *
> 
> Sporadic hard faults, how to find reason  
> [https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/?limit=25#6592](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/?limit=25#6592)
> 
> * * *
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 4:52pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/17 "2016-01-31T16:52:06Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#226d):

… same situation.

It is now a miracle for me, how to integrate trace into a project.

I alwas get the error, that Atmel Studio can’t find ‘trcKernelHooks.h’.

Lastly I tried, to type #include “”, than tab and he showed me a list of files. HE shows me the list and I think, he will find this files … I selected trcKernelHooks.h, and still get the … file not found error …

I also restarted the Atmel Studio 6.2, nothing helps.

Just a miracle.

Is it possible to add trace later or should I have added it at the beginning and now it is impossible for whar reason ever?

No more idea … sorry

With best regards

Gerhard

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 7:50pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/18 "2016-01-31T19:50:24Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#65f0):

… ok, now hanging at:

Error 34 implicit declaration of function ‘\_\_get\_PRIMASK’ [-Werror=implicit-function-declaration] …\src\TraceRecorder\trcBase.c 432 2

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 31, 2016, 7:55pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/19 "2016-01-31T19:55:54Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#65f0/37d1):

Putting \_\_get\_PRIMASK into Google shows me that this is a CMSIS  
function. Do you have the CMSIS headers included?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 31, 2016, 8:18pm UTC](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026/20 "2016-01-31T20:18:43Z")

</div>

**[gerhardkreuzer](https://sourceforge.net/u/gerhardkreuzer/)** wrote on [Sunday, January 31, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/53b486f2/#3446):

No, there is no info about that. But the ASF have such files added. Ok, will try around

[Next page](https://forums.freertos.org/t/sporadic-hard-faults-how-to-find-reason/2026.md?page=2)
