I believe that using malloc and free in small embedded system is a bad habit, although am using them for very specific circumstances.
so i’am using 2 tasks in my application :
LCDTask and SerialTask:
-The 2 tasks have the same priority.
- lcdSTACK_SIZE configMINIMAL_STACK_SIZE + 1000.
- serialSTACK_SIZE configMINIMAL_STACK_SIZE
- the pointer that am allocating/ freeing pointes to data with 200 bytes
- lcdTask allocate and free the pointer .
- the serial task doesn’t acces to the heap, no dynamic allocation.
If i run only the lcdtask no problem but if i add the serialTask the program crashes when meeting
freefunction but why (the serial task doesn’t acces to the heap).
You know debugging the
free function is difficult since it doesn’t return.
Could you please help me find roads to find the source of the problem