AnsweredAssumed Answered

Heap Allocation - Integrating MQX and PEG+

Question asked by OldNick on Jul 8, 2011
Latest reply on Jul 11, 2011 by OldNick

Have ported the BSP to my platform (K20) and worked through many of the MQX examples, which all work fine.

 

Now trying to integrate PEG+ into the platform, I have got to the point of building my first GUI application.

 

But at the conclusion of the make I get a linker error telling me there is no heap allocated.

Warning[Lp012]: no sections with name HEAP included - special symbol HEAP$$Base (referenced from xgetmemchunk.o(dl7M_tln.a)) will  be zero.

 

When I run the code, it drops into MQX-idle at the first point where the new operator is called.

 

I am using the icf provided with the MQX examples, which (as supplied) has neither stack nor heap.  This confused me a bit, since C-stack is usually the first thing set up by the RTL.  Therefore I assume that MQX handles stack and heap on its own.?

 

Anyway, I modified the icf from within IAR IDE to give myself a 64k heap, but still got the same linker error.  modified icf attached

 

What I really want to do is put all the GUI volatile stuff into an offchip SRAM which I have put on the board, leaving the On-chip memory for application stuff.  But for now, anything that gives me a heap section would be helpful.

 

Can you suggest anything?  Which manuals should I read?

Outcomes