cancel
Showing results for 
Search instead for 
Did you mean: 

alternative malloc implementation

tushar_tp
Associate III

Hello,

I am using Truestudio 9.2.0 with FreeRTOS 10.2.0

I want to add custom malloc implementation in my project.

I declared

void * malloc( size_t xSize )

{

//please add your own code

}

in my c files but it gives me error.

c:/program files (x86)/atollic/truestudio for stm32 9.2.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/lib/armv7e-m/fpu/fpv5-d16\libc_nano.a(lib_a-malloc.o): In function `malloc':

malloc.c:(.text.malloc+0x0): multiple definition of `malloc'

Is there any other definition or settings missing in my project?

Tushar

1 REPLY 1

Yeah, you're going to need to figure the settings so it doesn't pull in the nano libraries. The allocation routine is usually _sbrk in syscalls.c or an equivalent file.

Perhaps check Atollic documentation, and/or tutorial videos

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..