AnsweredAssumed Answered

Use malloc in CodeWarrior for HC08 : "out of allocation space in segment.."

Question asked by ppoi klm on Oct 3, 2007
Latest reply on Oct 11, 2007 by ppoi klm
I followed the instruction of the FAQ-27441 "Can I use malloc in CodeWarrior for HC(S)08?".
However I have an error of link "out of allocation space in segment HEAP_SEGMENT at adress 341".
Could you provide me a simple project without error. I need really to dynamically allocate memory in my project...


here the modifications brings to the project,

//----------------------------------------------------------------------
Modification of the file "libdefs.h"

#define LIBDEF_HEAPSIZE 20 // by default 2000

//----------------------------------------------------------------------

Here my file ".prm" :

SECTIONS
    ...
    RAM1 = READ_WRITE       0x0050 TO 0x0340;
    DG_HEAP  = READ_WRITE   0x0341 TO 0x044F;
       RAM2 = READ_WRITE       0x0A00 TO 0x0BFF;

PLACEMENT
    ...
    HEAP_SEGMENT                  INTO  DG_HEAP;
    SSTACK                        INTO  STK_AREA;

END

//----------------------------------------------------------------------

Development tool:

Version of CodeWarrior IDE 4.1 "Build 0669"
µc MC68HC908AZ60A

Outcomes