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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,722 次查看
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 项奖励
回复
1 解答
1,760 次查看
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 项奖励
回复
2 回复数
1,761 次查看
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 项奖励
回复
1,760 次查看
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 项奖励
回复