# Hard fault while calling Check Tasks Waiting Termination in Idle task

**URL:** <https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811>\
**Category:** Kernel\
**Created:** [April 6, 2022, 3:00pm UTC](https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811 "2022-04-06T15:00:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EyalG](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@EyalG](https://forums.freertos.org/u/EyalG)\
**Post date:** [April 6, 2022, 3:00pm UTC](https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811/1 "2022-04-06T15:00:36Z")

</div>

Hello,  
I have an issue similar to this [topic](https://forums.freertos.org/t/hard-fault-while-checking-for-terminated-tasks-in-idle-loop/13303)  
I’m getting an hard fault while running my STM32H7 FreeRTOS 10.3.1 based application, that is built out of 3 tasks and is working for a while (10min to an hour) with no problems and then fall into an hard fault always with the same PC value that lead to the call to prvCheckTasksWaitingTermination in the idle task.  
I’m running with configCHECK\_FOR\_STACK\_OVERFLOW, configUSE\_MALLOC\_FAILED\_HOOK and configASSERT.  
I also added configUSE\_LIST\_DATA\_INTEGRITY\_CHECK\_BYTES as I think some corruption is happing around the list handling from doing a lot of tries when I tried to catch the source of the issue before the hard fault.  
I’m working with ST CubeIDE and its fault analyzer list the fault as a “Bus, memory management or usage fault” and “Instruction access violation”  
Do you have any suggestion on how I can resolve this?  
Thanks,  
Eyal

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [April 6, 2022, 5:38pm UTC](https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811/2 "2022-04-06T17:38:18Z")

</div>

That surely seems like a memory corruption. Can you try increasing stack sizes of tasks one by one and see if that fixes the issue. Then we can use [uxTaskGetStackHighWaterMark](https://www.freertos.org/uxTaskGetStackHighWaterMark.html) to determine the stack requirements. If that does not help, can you try disabling tasks one by one and try to determine the culprit one?

Thanks.

---

<div class="post-metadata">

**Author:** ![EyalG](https://avatars.discourse-cdn.com/v4/letter/e/b782af/32.png) [@EyalG](https://forums.freertos.org/u/EyalG)\
**Post date:** [April 11, 2022, 9:10am UTC](https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811/3 "2022-04-11T09:10:22Z")

</div>

Hi Gaurav,  
I tried all you suggestions but this issue is still there, as an outcome from some of the changes I did I got an assertion from a graphic library I’m using (TouchGFX) but its hard for me to believe that the problem is in the lib, I assume it is some memory issue that is “hiding” from me.  
The fact that most of the time, after I made some changes during the debug process, I’m keep getting hard fault on the same FreeRTOS place (i.e. prvCheckTasksWaitingTermination ) is some kind of a clue, don’t you think?  
The only problem is that I do not understand the clue…  
Any ideas?  
Thanks,  
Eyal

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [April 11, 2022, 10:39am UTC](https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811/4 "2022-04-11T10:39:19Z")

</div>

> [@EyalG](#):
>
> The only problem is that I do not understand the clue…

The memory corruptions are hard to debug. When it crashes, can you see the task list and examine if any TCB seems corrupted? That way we can find if a TCB is getting corrupted.

One usual technique to debug memory corruption is to put a variable next to the one getting corrupted. Then you can put a data breakpoint on that variable to catch the corruption when it happens. The hope here is that the corruption is large enough to corrupt the variable that we put.

Which STM32H7 are you using? I have one Nucleo-H743ZI2 dev board - if you are using that and are willing to share your code, I can give it a try too.

Thanks.

---

<div class="post-metadata">

**Author:** ![HuangThailand](https://avatars.discourse-cdn.com/v4/letter/h/7ea924/32.png) [@HuangThailand](https://forums.freertos.org/u/HuangThailand)\
**Post date:** [June 10, 2025, 8:54am UTC](https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811/5 "2025-06-10T08:54:43Z")

</div>

Hello, I encountered the same problem in the project as you described. May I ask if your issue had been resolved at the end of time? Could you please give me some insights? Thank you.

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [June 11, 2025, 6:18am UTC](https://forums.freertos.org/t/hard-fault-while-calling-check-tasks-waiting-termination-in-idle-task/14811/6 "2025-06-11T06:18:42Z")

</div>

Are you also getting a hard fault? If yes, can you try to determine the faulting instruction - [https://www.keil.com/appnotes/files/apnt209.pdf](https://www.keil.com/appnotes/files/apnt209.pdf)?
