Search code examples
freertos

undefined reference to `pvPortMalloc'


I'm tying to build project with FreeRTOS(last version). And I have 20170907-1650 version of Eclipse. And in process of buld I have got the errors what I can't solve by myself. Cause of what, I asking help in this event. Pasting list of similar errors:

  • undefined reference to `pvPortMalloc'
  • undefined reference to `vPortFree'
  • undefined reference to `vApplicationStackOverflowHook'

Solution

  • As pointed in comment, see Heap Memory Management, freertos doesn't provide malloc/free functions.

    You'll have to:

    • Modify FreeRTOSConfig.h to set
      • configSUPPORT_DYNAMIC_ALLOCATION to 1
      • configAPPLICATION_ALLOCATED_HEAP to 4 (you can replace 4 according to your needs)
    • Add the file heap_4.c to your project (same remark as above)