Don't know about KDS 3.0, KSDK 1.2 but in previous versions malloc was a mess.
How is your malloc implemented? How does it interact with FreeRTOS memory allocation?
How is your malloc protected from re-entrancy in multitasking environment?
From my old notes to myself:
"Newlib has its own malloc/free and FreeRTOS has its own equivalent routines. To use newlib malloc in multitasking environment we are supposed to provide locking functions __malloc_lock/unclock. Unfortunately these are never called by newlib-nano. We will junk newlib malloc and friends and override them with wrapped FreeRTOS routines. Note: newlib will go and do malloc/free behind your back, so we cannot just use FreeRTOS routines in our code. Implementation: use heap_4.c from portable dir to get FreeRTOS memory allocator, update it to stick its heap array into second RAM page of K22 Kinetis via attribute, update linker script not to waste any RAM for newlib heap."
Hope this helps.
Regards,
Sergei
P.S. I do not use PE or included KSDK port of FreeRTOS.