Creating tasks within tasks

I have taken the lpc2148 demo code provided by J.C.Wren and was modifying it to add one more command processing task to it.This task I am creating before the scheduler starts.Now from this task I need to create another task which is not getting spawned.Is there any limitation in FreeRTOS for doing this?

Creating tasks within tasks

You have probably just run out of FreeRTOS heap. Try increasing configTOTAL_HEAP_SIZE in FreeRTOSConfig.h. If you can’t link your application after increasing the heap you will have to optimize your RAM usage instead by reducing stack sizes, combining tasks, looking for other RAM savings.

Creating tasks within tasks

Thanks for the quick response. I verified that I have not run out of FreeRTOS heap. Meanwhile, when I removed the optimization in the Makefile(it wa O3), the code behaves correctly. Still could not figure out what exactly was going wrong