Hi @marcomello95 :
MQX uses its own memory allocation system, which does not reply on heap. The default MQX memory pool, where MQX kernel allocates system memory, is between __KERNEL_DATA_START and __KERNEL_DATA_END (symbols generated during bsp linkage).
MQX allocates memory using function _mem_alloc_system(). On top of this, in bsp we can define malloc() to call _mem_alloc_system(), to do this you need to follow these steps:
- First you have to define _mem_alloc_system* in preprocessor to be malloc
#define _mem_alloc_system malloc
- Then disable bsp "duplicate" definition of malloc (either by link order or be removing the duplicate definition from the sources).
Regards
Daniel