# Control is going to Hardfault handler

**URL:** <https://forums.freertos.org/t/control-is-going-to-hardfault-handler/10191>\
**Category:** Libraries\
**Created:** [July 6, 2020, 5:52am UTC](https://forums.freertos.org/t/control-is-going-to-hardfault-handler/10191 "2020-07-06T05:52:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kumar](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Kumar](https://forums.freertos.org/u/Kumar)\
**Post date:** [July 6, 2020, 5:52am UTC](https://forums.freertos.org/t/control-is-going-to-hardfault-handler/10191/1 "2020-07-06T05:52:09Z")

</div>

Hi,

I am working on freertos. As a continuation of the thread [Sending Data from ISR to one Task and sending to another task with two queues](https://forums.freertos.org/t/sending-data-from-isr-to-one-task-and-sending-to-another-task-with-two-queues/10171/7)  
I have created new thread for this problem.

The code is running for some time and getting stopped after that. To know that I have run the program in debug mode. The control is going into Hard fault Handler.

 ![HardFaultHandler](https://d2v6vdsk2p900z.cloudfront.net/original/1X/06f5dfc4203f27a9b9406a566c551b0bf37bf1ee.png)

 ![HardFaultHandler](https://d2v6vdsk2p900z.cloudfront.net/original/1X/06f5dfc4203f27a9b9406a566c551b0bf37bf1ee.png)

Here is the disassembly code screenshot for first signal handler and second signal handler

 ![FirstSignalHandler](https://d2v6vdsk2p900z.cloudfront.net/original/1X/30f71085a8149f570cd1b5af4c27c368df384780.png)

 ![Second signal handler](https://d2v6vdsk2p900z.cloudfront.net/original/1X/4e8b02f1a87a22f5392a5eb7f09761deca579bfd.png)

Let me know anything to look after.

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [July 6, 2020, 11:11am UTC](https://forums.freertos.org/t/control-is-going-to-hardfault-handler/10191/2 "2020-07-06T11:11:02Z")

</div>

First comment, the addresses “FFFFFFFD” and “FFFFFFF1” are special codes that interrupts/trap use, and not really addresses. The FFFFFFFD means that when tracing back, you really should switch back from the interrupt stack to the main program stack (which many debuggers unfortunately aren’t smart enough to do).

One thing to make sure you do is define configASSERT in a way that you can tell if it gets called, which typically means having it disable interrupts and then going into an infinite loop. This will have FreeRTOS check a number of aspects of the setup to find a number of the common problems. One very common problem is using FreeRTOS functions in an ISR with to high of a priority (too small of a value), which makes the critical sections non-functional, and some of the data structures inside FreeRTOS get corrupted.
