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
Solved! Go to Solution.
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.
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.
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