Undefined reference to `pvPortMalloc' when build MCUXpresso project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undefined reference to `pvPortMalloc' when build MCUXpresso project

582 Views
TiDiChi
Contributor I

I have just created a mcuxpresso project. this used freertos component from adding operating systerm in SDK wizard.

When i run file main without using xTaskCreate function, build successed. then i add a task, build failed.

My IDE uses sdk version 2.14.0 and manifest vesion 3.13.0.

What do i need to fix this bug ?

0 Kudos
3 Replies

513 Views
TiDiChi
Contributor I

Hi @Harvey021

This error exists because heap file is not in MemMang folder (FreeRTOS component).

I solved my issuse by downgrading SDK version from 2.14 down 2.13 and manifest version from 3.13.0 down to 3.10.0

 

Best regards

TiDiChi

 

0 Kudos

553 Views
Harvey021
NXP TechSupport
NXP TechSupport

Hi @TiDiChi 

Can you share the build error?

 

Best regards

Harvey

0 Kudos

106 Views
stefanct
Contributor III

The problem, as @TiDiChi noted, is that the MemMang does not contain any files where the different heap implementations of FreeRTOS should be visible, i.e., the contents of rtos/freertos/freertos-kernel/portable/MemMang. However, only one of the implementations is supposed to be compiled and linked in eventually, depending on the heap type selected via `configFRTOS_MEMORY_SCHEME` in `FreeRTOSConfig.h` because they all implement the same functions (e.g., `pvPortMalloc`).
I think it should be rather easy to reproduce if you link the SDK sources instead of copying them. I have not tested it with the latter. At least I ran into this with 11.9.0 and SDK 2.15.0 (from git).

Once the correct heap*.c is added to the project (manually), it compiles fine.

The question is if MCUX is supposed to support heaps at all and if so how to choose the correct version?

0 Kudos