# Question | AsserAlert!

**URL:** <https://forums.freertos.org/t/question-asseralert/11138>\
**Category:** Kernel\
**Created:** [November 15, 2020, 6:47pm UTC](https://forums.freertos.org/t/question-asseralert/11138 "2020-11-15T18:47:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Salama](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@Ahmed\_Salama](https://forums.freertos.org/u/Ahmed_Salama)\
**Post date:** [November 15, 2020, 6:47pm UTC](https://forums.freertos.org/t/question-asseralert/11138/1 "2020-11-15T18:47:08Z")

</div>

Hello,

I am new with FreeRTOS and I can not create task for some reason here is the code and the error

Thanks in advance

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/c/cd3ec3c9c4ddbd4213cef3133fa91bc3859f157e.png)

---

<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:** [November 15, 2020, 7:20pm UTC](https://forums.freertos.org/t/question-asseralert/11138/2 "2020-11-15T19:20:33Z")

</div>

I guess the task code using `printf` is not part of the original demo, right ?  
`printf` notoriously needs quite a lot of stack and you set the task stack to the very minimum. So there is almost for sure a stack overflow crash.  
You should set the task stack size to a reasonable large value for demo testing (e.g. 1000).  
Later on for real projects stack size needs a good, more tailored estimation  
and [task stack checking](https://www.freertos.org/Stacks-and-stack-overflow-checking.html) enabled during development.  
There are also a number of related posts here in the forum where people struggled with the same or similar problem.

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salama](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@Ahmed\_Salama](https://forums.freertos.org/u/Ahmed_Salama)\
**Post date:** [November 15, 2020, 8:31pm UTC](https://forums.freertos.org/t/question-asseralert/11138/3 "2020-11-15T20:31:11Z")

</div>

Nope , I tried 1000 in stack size but did not work ☹

---

<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:** [November 15, 2020, 9:59pm UTC](https://forums.freertos.org/t/question-asseralert/11138/4 "2020-11-15T21:59:22Z")

</div>

Ok, then something else is broken. For sure the `printf` in the demo task would have caused an stack overflow crash once the tasks is started successfully.  
Did you enable configASSERT and the other checks to be able to nail the point of failure ? You really should do this. Otherwise it might be hard and tedious to find and fix your problem.  
Did you setup the demo application yourself or do you use an SDK which created this example FreeRTOS application ?  
There are also some drivers needed to make `printf` to output something.  
Where is the init of the (UART ?) peripheral driver or is it working when `printf` something in `main`without FreeRTOS / tasks ?

---

<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:** [November 15, 2020, 10:29pm UTC](https://forums.freertos.org/t/question-asseralert/11138/5 "2020-11-15T22:29:29Z")

</div>

Are you using the Windows port? If so then, unlike other ports, it is unlikely to be a stack overflow.

The screen shot shows that a break point has been hit - not that it has crashed - if you pause the debugger or close the message window what is the application doing? What happens if you delete all break points? Is the assert() defined with a software breakpoint?

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salama](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@Ahmed\_Salama](https://forums.freertos.org/u/Ahmed_Salama)\
**Post date:** [November 16, 2020, 4:45pm UTC](https://forums.freertos.org/t/question-asseralert/11138/6 "2020-11-16T16:45:17Z")

</div>

every thing as it is from the demo expect the code in SS … I just want to try the task is there another way of doing that instead of printf ?

Also the demo version has printf

---

<div class="post-metadata">

**Author:** ![stjepan\_skrnjug](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stjepan\_skrnjug](https://forums.freertos.org/u/stjepan_skrnjug)\
**Post date:** [November 19, 2020, 12:26pm UTC](https://forums.freertos.org/t/question-asseralert/11138/7 "2020-11-19T12:26:36Z")

</div>

For test purposes, you could make a global variable which you will increment/ decrement in your task and watch in some Watch Window.

There is one thread which can help you understand your problem :

> <https://stackoverflow.com/questions/55187546/unable-to-use-printf-outside-of-main-unless-printf-is-used-at-least-once-in>
