# AVR32 + FreeRTOS + LwIP create task problem

**URL:** <https://forums.freertos.org/t/avr32-freertos-lwip-create-task-problem/2749>\
**Category:** Kernel\
**Created:** [May 28, 2012, 3:37am UTC](https://forums.freertos.org/t/avr32-freertos-lwip-create-task-problem/2749 "2012-05-28T03:37:18Z")\
**Posts on this page:** 3\
**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:** [May 28, 2012, 3:37am UTC](https://forums.freertos.org/t/avr32-freertos-lwip-create-task-problem/2749/1 "2012-05-28T03:37:18Z")

</div>

**anonymous** wrote on [Monday, May 28, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/7b75fe55/#1001):

I am modifing the demo example : AVR32 with FreeRTOS and LwIP provided by Atmel for my application.

I removed the original created task: Basic Web, Basic SMTP and BASIC TFTP, and added my own tasks: SIP\_UAC, SIP\_UAS and RTP.

The stask size parameter in the create- task function is: SIP\_UAC: 256, SIP\_UAS: 256, RTP:128. They are smaller than the original provided tasks. When I run the software, I found that the SIP\_UAS task can not be created and return NULL. So I removed almost all the things inside the SIP\_UAS task and set the stack size parameter to 32 only, the code is now:

```
#include "FreeRTOS.h"
#include "task.h"
portTASK_FUNCTION( vUASTask, pvParameters)
{
     vTaskDelay(100);
}

```

However, the task still can not be created. Then I removed the SIP\_UAC, the SIP\_UAS task now can be created. And then I remove SIP\_UAS and restore SIP\_UAC, the task can be created. I found that it has problem if both SIP\_UAC and SIP\_UAS exist……but the SIP\_UAS task basically has nothing inside except the vTaskDelay() funcion……&nbsp; anybody can give me some advice? Thank you very much

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 28, 2012, 3:58am UTC](https://forums.freertos.org/t/avr32-freertos-lwip-create-task-problem/2749/2 "2012-05-28T03:58:12Z")

</div>

**anonymous** wrote on [Monday, May 28, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/7b75fe55/#206a):

Sorry the code should be:

```
#include "FreeRTOS.h"
#include "task.h"
portTASK_FUNCTION( vUASTask, pvParameters)
{
    for(;;){
     vTaskDelay(100);
    }
}
```

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [May 28, 2012, 8:20am UTC](https://forums.freertos.org/t/avr32-freertos-lwip-create-task-problem/2749/3 "2012-05-28T08:20:37Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Monday, May 28, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/7b75fe55/#73a5):

When you converted the Atmel project, did you change any setting in FreeRTOSConfig.h? If the project used to create more tasks with bigger stacks than your application is trying to do then you should not have an issue with the task stack sizes. Step through the xTaskCreate() function to see where it fails. If you are using heap\_1.c or heap\_2.c then you can also define a malloc failed hook function (vApplicationMallocFailed() I think) to trap memory allocation problems.

What is configTOTAL\_HEAP\_SIZE set to in FreeRTOSConfig.h (only relevant if heap\_1.c or heap\_2.c is used)?
