# freeRTOS Stacktrace M7

**URL:** <https://forums.freertos.org/t/freertos-stacktrace-m7/6911>\
**Category:** Kernel\
**Created:** [December 18, 2017, 1:14pm UTC](https://forums.freertos.org/t/freertos-stacktrace-m7/6911 "2017-12-18T13:14:58Z")\
**Posts on this page:** 5\
**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:** [December 18, 2017, 1:14pm UTC](https://forums.freertos.org/t/freertos-stacktrace-m7/6911/1 "2017-12-18T13:14:58Z")

</div>

**[jinwoo](https://sourceforge.net/u/jinwoo/)** wrote on [Monday, December 18, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/3c6dbe51/#70b1):

Hi

I’ve read about debugging hardfault in this article

[https://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html](https://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html)

I would however appricate some help to port this to M7. The reason being that I seam to get incorrect data. For example the program counter always shows 0x00.

Do anyone know how to change the assembler code to fetch the correct data ?

---

<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:** [December 18, 2017, 4:58pm UTC](https://forums.freertos.org/t/freertos-stacktrace-m7/6911/2 "2017-12-18T16:58:01Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, December 18, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/3c6dbe51/#70b1/37e8):

The code is the same for all Cortex-M3, M4, M4F and M7 ports. If the PC  
is 0 then that is probably the cause of the hard fault. Could it be you  
jumped to a NULL pointer? Alternatively see the section “Handling  
Imprecise Faults” on the page you linked to to see if that applies to you.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 19, 2017, 10:07am UTC](https://forums.freertos.org/t/freertos-stacktrace-m7/6911/3 "2017-12-19T10:07:31Z")

</div>

**[jinwoo](https://sourceforge.net/u/jinwoo/)** wrote on [Tuesday, December 19, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/3c6dbe51/#70b1/37e8/d085):

Thanks for your answer ! After some tests I have noticed that the behaviour occurs only when I have a watchdog enabled. Even if it doesnt trigger a reset it seams to change the behaviour of what data is read by the code added in the article.

Do you have any suggestion of what might cause this ?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 19, 2017, 10:07am UTC](https://forums.freertos.org/t/freertos-stacktrace-m7/6911/4 "2017-12-19T10:07:35Z")

</div>

**[jinwoo](https://sourceforge.net/u/jinwoo/)** wrote on [Tuesday, December 19, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/3c6dbe51/#70b1/37e8/3eef):

Thanks for your answer ! After some tests I have noticed that the behaviour occurs only when I have a watchdog enabled. Even if it doesnt trigger a reset it seams to change the behaviour of what data is read by the code added in the article.

Do you have any suggestion of what might cause this ?

---

<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:** [December 19, 2017, 3:47pm UTC](https://forums.freertos.org/t/freertos-stacktrace-m7/6911/5 "2017-12-19T15:47:40Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, December 19, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/3c6dbe51/#70b1/37e8/3eef/3ba0):

Could it be something to do with the ‘imprecise’ faults? So the fault  
actually occurs sometime before the exception handler is called? As the  
the paragraph noted in my last post.
