2019-03-10 02:13 PM
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
2019-03-10 06:16 PM
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