# "Stack overflow" on Task Name "EthIf"

**URL:** <https://forums.freertos.org/t/stack-overflow-on-task-name-ethif/14748>\
**Category:** ST\
**Tags:** debug\
**Created:** [March 28, 2022, 2:53pm UTC](https://forums.freertos.org/t/stack-overflow-on-task-name-ethif/14748 "2022-03-28T14:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZergOfSwarm](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/zergofswarm/32/2375_2.png) [@ZergOfSwarm](https://forums.freertos.org/u/ZergOfSwarm)\
**Post date:** [March 28, 2022, 2:53pm UTC](https://forums.freertos.org/t/stack-overflow-on-task-name-ethif/14748/1 "2022-03-28T14:53:16Z")

</div>

I’m beginner in FreeRTOS…  
Could some one tell me which parameters in FreeRTOS do I need to increase/decrease for stop writing me constantly “Stack overflow” on  
Task Name “EthIf”? see my screen [77 — ImgBB](https://ibb.co/hZ8WpGQ)

---

<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:** [March 28, 2022, 2:56pm UTC](https://forums.freertos.org/t/stack-overflow-on-task-name-ethif/14748/2 "2022-03-28T14:56:50Z")

</div>

The stack size is a parameter passed into the function used to create the task. See the xTaskCreate() and xTaskCreateStatic() API documentation on the [FreeRTOS.org](http://FreeRTOS.org) site. I would post a link but am not on my computer at the moment.

---

<div class="post-metadata">

**Author:** ![gedeonag](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/gedeonag/32/479_2.png) [@gedeonag](https://forums.freertos.org/u/gedeonag)\
**Post date:** [March 28, 2022, 5:41pm UTC](https://forums.freertos.org/t/stack-overflow-on-task-name-ethif/14748/3 "2022-03-28T17:41:14Z")

</div>

> **[This page describes the RTOS xTaskCreate() FreeRTOS API function which is...](https://www.freertos.org/a00125.html)**
>
> FreeRTOS is an open source, small footprint RTOS for microcontrollers. This page describes the xTaskCreate() FreeRTOS API function which is part of the RTOS task control API.

> **[This page describes the FreeRTOS xTaskCreateStatic() API function which...](https://www.freertos.org/xTaskCreateStatic.html)**
>
> Using xTaskCreateStatic() to create an RTOS task using statically allocated memory.

---

<div class="post-metadata">

**Author:** ![hahaha](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hahaha](https://forums.freertos.org/u/hahaha)\
**Post date:** [May 7, 2024, 8:14am UTC](https://forums.freertos.org/t/stack-overflow-on-task-name-ethif/14748/4 "2024-05-07T08:14:44Z")

</div>

In my case I adjusted stack size manually.  
I adjusted on STM32CubeMX but It doesn’t work.  
because stack size code was in user code block.

----------------before----------------  
**#define INTERFACE\_THREAD\_STACK\_SIZE ( 350 )**

_/ USER CODE BEGIN OS\_THREAD\_NEW\_CMSIS\_RTOS\_V2 /_  
memset(&attributes, 0x0, sizeof(osThreadAttr\_t));  
attributes.name = “EthIf”;  
**attributes.stack\_size = INTERFACE\_THREAD\_STACK\_SIZE;** _← increase this value_  
attributes.priority = osPriorityLow;  
osThreadNew(ethernetif\_input, netif, &attributes);  
_/ USER CODE END OS\_THREAD\_NEW\_CMSIS\_RTOS\_V2 /_

----------------after----------------  
**#define ETHIF\_STACK\_SIZE 1024**  
/\* USER CODE BEGIN OS\_THREAD\_NEW\_CMSIS\_RTOS\_V2 _/  
memset(&attributes, 0x0, sizeof(osThreadAttr\_t));  
attributes.name = “EthIf”;  
 **attributes.stack\_size = ETHIF\_STACK\_SIZE ;**  
attributes.priority = osPriorityLow;  
osThreadNew(ethernetif\_input, netif, &attributes);  
/_ USER CODE END OS\_THREAD\_NEW\_CMSIS\_RTOS\_V2 \*/

---

<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:** [May 7, 2024, 9:19am UTC](https://forums.freertos.org/t/stack-overflow-on-task-name-ethif/14748/5 "2024-05-07T09:19:24Z")

</div>

Thank you for sharing your solution.
