PE-MQX memory Heap(where is it hidden?)

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

PE-MQX memory Heap(where is it hidden?)

Jump to solution
1,951 Views
georgiad
Contributor III

Hi

I started a new PE-MQX project. I have many matrixes to allocate in heap.

When I increase the number of the matrixes it hangs. I suppose it is because

default heap is smaller than that I need. But where is hidden heap memory

and which is the default size?  It seems that in MQX component a user

function must be created to be "suitable for usage by RTOS component" as it is

written in the help file. What exactly it means "suitable" and how this function

is written?     Using mem_alloc_system or something else? And where should I

place this function?

Thanks

0 Kudos
1 Solution
989 Views
marek_vinkler
NXP Employee
NXP Employee

In case of integration PEx with MQX, the heap allocation is not a part of Processor Expert generated code. Heap size is usually allocated in the linker command file which is a part of your application (not a part of BSP). MQX RTOS component allows you to choose between standard MQX memory allocation functions or user defined. When you choose “user defined” then you need to specified a function name with the same prototype like the original one in MQX. Definition of your function can be anywhere in .c module in your application.

View solution in original post

0 Kudos
2 Replies
990 Views
marek_vinkler
NXP Employee
NXP Employee

In case of integration PEx with MQX, the heap allocation is not a part of Processor Expert generated code. Heap size is usually allocated in the linker command file which is a part of your application (not a part of BSP). MQX RTOS component allows you to choose between standard MQX memory allocation functions or user defined. When you choose “user defined” then you need to specified a function name with the same prototype like the original one in MQX. Definition of your function can be anywhere in .c module in your application.

0 Kudos
989 Views
Akshaya_Mukund
Contributor I

Could you please point me to the place where the heap can be physically set ? I am working on a Twr-K60N512.

 

I am assuming that the Stack is set at the point where the task template is initialized. Also is the stack/heap implementation a common overlapping memory which grow outwards ? I need a further 30kb (beyond whatever default heap is available) of heap memory for my application (it crashes now due to unavailablility of heap).

 

As of now I allocate memory dynamically using _mem_alloc().

 

Any help/pointer would be welcome.

 

Thanks

0 Kudos