Application fails to run when using MCUXpresso style Managed Linker Script

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

Application fails to run when using MCUXpresso style Managed Linker Script

648 Views
uaz
Contributor II

Hi,

I am running Freertos Blinky example on my LPC4357 board.

Everything runs correctly until I changed the Managed Linker Script method to MCUXpresso Style.

After checking, it seems like my freertos malloc (from stdlib.h) failed to allocate 512 bytes when starting the scheduler.

May I know if someone has experienced this before and how to fix it?

This is my Managed Linker Script setting:

MCUxpresso Managed linker script.JPG

This is the output of the build with --print-memory-usage linker option:

MCUxpresso Style.JPG

Any help would be greatly appreciated.

Thanks,

UAZ

0 Kudos
1 Reply

509 Views
lpcxpresso_supp
NXP Employee
NXP Employee

As described in section 16.10.1, "MCUXpresso style Heap and Stack", of the MCUXpresso IDE v10.2 User Guide, when you are using this model - the heap (and stack) have a default size of 1/16th of the memory region size (up to a max of 4KB). You probably just need to allocate a larger size than the default.

You won't see this issue with the "LPCXpresso style" as with this model, the heap and stack are not set up with limits by default (see the User Guide for more details).

Alternatively, you might want to consider moving to a different FreeRTOS memory model (rather than relying on the default C library memory routines). For more details see:

Regards,

MCUXpresso IDE Support