# My code stuck in HARDFAULT handler

**URL:** <https://forums.freertos.org/t/my-code-stuck-in-hardfault-handler/10592>\
**Category:** Kernel\
**Created:** [September 2, 2020, 7:04pm UTC](https://forums.freertos.org/t/my-code-stuck-in-hardfault-handler/10592 "2020-09-02T19:04:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![enggparth](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/enggparth/32/851_2.png) [@enggparth](https://forums.freertos.org/u/enggparth)\
**Post date:** [September 2, 2020, 7:04pm UTC](https://forums.freertos.org/t/my-code-stuck-in-hardfault-handler/10592/1 "2020-09-02T19:04:06Z")

</div>

When i tried to integrate FreeRTOS with STM32 HAL library + Segger, my code catch hard fault.

Please find attached screenshot.

Thanks  
Parth

 ![error1](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7e12f7723fd984946d4b34736837db9a57880bc7.jpeg)

---

<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:** [September 2, 2020, 7:24pm UTC](https://forums.freertos.org/t/my-code-stuck-in-hardfault-handler/10592/2 "2020-09-02T19:24:54Z")

</div>

I recommend starting with the items here [https://www.freertos.org/FAQHelp.html](https://www.freertos.org/FAQHelp.html) - paying particular attention to making sure you have configASSERT() defined and stack overflow checking on. If that doesn’t help, and if your IDE won’t decode the hard fault for you, the page also contains a link ([https://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html](https://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html)) to information on how to decode a hard fault.
