problem with the `free` function

bou6 wrote on Wednesday, July 20, 2016:

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 free function 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

edwards3 wrote on Wednesday, July 20, 2016:

Have you seen this page? http://www.freertos.org/a00111.html

bou6 wrote on Wednesday, July 20, 2016:

Ok Thank you for the reference