# FreeRTOS doing no more 2 task

**URL:** <https://forums.freertos.org/t/freertos-doing-no-more-2-task/13798>\
**Category:** Kernel\
**Created:** [October 31, 2021, 5:24pm UTC](https://forums.freertos.org/t/freertos-doing-no-more-2-task/13798 "2021-10-31T17:24:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addi](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@addi](https://forums.freertos.org/u/addi)\
**Post date:** [October 31, 2021, 5:24pm UTC](https://forums.freertos.org/t/freertos-doing-no-more-2-task/13798/1 "2021-10-31T17:24:35Z")

</div>

Hello!

Can anybody say what I need to define to use more than 2 tasks?  
With 2 tasks or 1 all is work fine but when I increase further? - no task is execiting  
I tried to change priority but I doesnt help!

Please help!

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [October 31, 2021, 5:46pm UTC](https://forums.freertos.org/t/freertos-doing-no-more-2-task/13798/2 "2021-10-31T17:46:02Z")

</div>

FreeRTOS works just fine with many tasks. Some things to check:

Make sure you have enough heap to create the tasks if you are not using the ‘static’ creation functions. Defining the malloc failed hook can help a lot here.

Make sure your tasks block when they don’t have work to do. This is a very different way to program than the ‘single task’ mode of thinking.

---

<div class="post-metadata">

**Author:** ![hs2](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@hs2](https://forums.freertos.org/u/hs2)\
**Post date:** [October 31, 2021, 6:19pm UTC](https://forums.freertos.org/t/freertos-doing-no-more-2-task/13798/3 "2021-10-31T18:19:58Z")

</div>

What did you do to find the problem so far ?  
Did you define [configASSERT](https://www.freertos.org/a00110.html?_ga=2.213540052.1971135108.1609110559-800452554.1575115350#configASSERT), enabled [stack overflow checking](https://www.freertos.org/Stacks-and-stack-overflow-checking.html)and maybe also configUSE\_MALLOC\_FAILED\_HOOK (see [Hook Functions doc](https://www.freertos.org/a00016.html)) for development/debugging ?  
Maybe you just run out of heap space creating more tasks.  
Do you check the return values/error codes of the resource allocation functions like `xTaskCreate` ?
