Question | AsserAlert!


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

Thanks in advance

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 enabled during development.
There are also a number of related posts here in the forum where people struggled with the same or similar problem.

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

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 mainwithout FreeRTOS / tasks ?

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?

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

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 :