# Stack destroyed after return from long vTaskDelay

**URL:** <https://forums.freertos.org/t/stack-destroyed-after-return-from-long-vtaskdelay/24787>\
**Category:** Kernel\
**Created:** [December 19, 2025, 10:05am UTC](https://forums.freertos.org/t/stack-destroyed-after-return-from-long-vtaskdelay/24787 "2025-12-19T10:05:35Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![rasty1](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rasty1/32/5886_2.png) [@rasty1](https://forums.freertos.org/u/rasty1)\
**Post date:** [December 31, 2025, 9:07am UTC](https://forums.freertos.org/t/stack-destroyed-after-return-from-long-vtaskdelay/24787/21 "2025-12-31T09:07:10Z")

</div>

Correct, data structure adds about 1K to task context.  
There is a solution for that if you have inexpensive memory like DDR or SDRAM. You can patch tasks.c and store pointer to an area, which is allocated in other pool.

---

<div class="post-metadata">

**Author:** ![rasty1](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rasty1/32/5886_2.png) [@rasty1](https://forums.freertos.org/u/rasty1)\
**Post date:** [December 31, 2025, 9:14am UTC](https://forums.freertos.org/t/stack-destroyed-after-return-from-long-vtaskdelay/24787/22 "2025-12-31T09:14:09Z")

</div>

Hi  
At the end I can tell that problem is solved, it was combination :

1. Fix FreeRTOS reenterancy suport in FreeRTOS wrappers supplied by TI.
2. implement \_\_retarget\_lock function
3. Migration to different (older) compiler and libc.

Developers that work with TI can follow the thread - [AM5726: \_impure\_ptr and \_\_retarget\_lock\* - Processors forum - Processors - TI E2E support forums](https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1601648/am5726-_impure_ptr-and-__retarget_lock).  
Thank you very much for support.

---

<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:** [December 31, 2025, 9:16am UTC](https://forums.freertos.org/t/stack-destroyed-after-return-from-long-vtaskdelay/24787/23 "2025-12-31T09:16:07Z")

</div>

> [@rasty1](#):
>
> (cannot post link here)

You should now be able to post links. Also, I edited your post to include the link. Please check that it is the link you wanted to include.

[Previous page](https://forums.freertos.org/t/stack-destroyed-after-return-from-long-vtaskdelay/24787.md?page=1)
